如何给动态生成的ActiveBar加快捷键

qpalzmn001 2010-03-15 01:35:55
如题,我用aTool.ShortCuts = "Alt+N"提示 “对象 shortcuts 的方法 itool 失败”
请问我应该怎么添加,谢谢
...全文
233 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
cqq_chen 2010-03-23
  • 打赏
  • 举报
回复
常用F1对你会有很大的帮助!!!
Sets or returns a string array of shortcut keys for the tool.

Syntax
[form!]Tool.ShortCuts[ = value As Variant ]

Remarks
The first element in the array will be displayed on the menu as the default shortcut.

To assign values to the ShortCuts property you must first declare a string array as a New shortcut type. You can then use the shortcut value property to assign values to the array items. You can use "Alt", "Control" and "Shift" in the string to specify the <Alt>, <Control> and <Shift> keys respectively. You must spell out the words "Control" and "Shift". The shortcut must be specified in Alt, Control, Shift order. Entering "Control+Alt+N" will generate an error. There cannot by any spaces within the string.

To clear a shortcut, user the shortcut clear method.

Example
Assign Shortcuts:

Private Sub CreateStandardTools()
Dim oTool As Tool
Dim saShortcuts(4) As New ShortCut
' Shortcuts
saShortcuts(0).Value = "Control+Shift+A"
saShortcuts(1).Value = "Control+B"
saShortcuts(2).Value = "Alt+Control+C"
saShortcuts(3).Value = "Alt+O"
saShortcuts(4).Value = "F8"

Set oTool = ActiveBar2.Tools.Add(GetUniqueToolID(), "Open")
oTool.ControlType = ddTTButton
oTool.Caption = "&Open"
oTool.Shortcuts = saShortcuts
End Sub


Clear Shortcut:

Dim saShortcuts(4) As New ShortCut
' Shortcuts
saShortcuts(0).Clear
saShortcuts(1).Clear
saShortcuts(2).Clear
saShortcuts(3).Clear
saShortcuts(4).Clear

ActiveBar2.Tools("Open").Shortcuts = saShortcuts


Data Type
shortcut
qpalzmn001 2010-03-23
  • 打赏
  • 举报
回复
还有像是ESC键怎么表达,谢谢
qpalzmn001 2010-03-23
  • 打赏
  • 举报
回复
谢谢,再问一下,如果我是想ALT+N的话我应该怎么用,ALT好像他是不认的Alter也没用
cqq_chen 2010-03-23
  • 打赏
  • 举报
回复
Dim saShortcuts(4) As New ShortCut
cqq_chen 2010-03-23
  • 打赏
  • 举报
回复
这个控件所有的属性都是区分大小写
qpalzmn001 2010-03-23
  • 打赏
  • 举报
回复
谢谢了,我也晕了,我用了大写的ALT他就不认得了,用Alt就可以。。。真晕。。
cqq_chen 2010-03-22
  • 打赏
  • 举报
回复
我一直在用2.0,没有出现你说的问题,设置方式如上
cqq_chen 2010-03-22
  • 打赏
  • 举报
回复
With ActiveBar
saShortcuts(0).Value = "Control+N"
.Tools("tNew").ShortCuts = saShortcuts
qpalzmn001 2010-03-22
  • 打赏
  • 举报
回复
请问saShortcuts(0).Value 是什么控件?
qpalzmn001 2010-03-17
  • 打赏
  • 举报
回复
我的就是ActiveBar3.0,我也是新用,听说还挺有名的
  • 打赏
  • 举报
回复
楼主,我们讲的好像不是同个控件,我的是Sheridan active toolbar plus(记忆中),您的呢?
qpalzmn001 2010-03-16
  • 打赏
  • 举报
回复
我用的是3.0,没有你说的那个属性,只有我这个
qpalzmn001 2010-03-16
  • 打赏
  • 举报
回复
to三楼:不行啊,我就是这么做的了,这样ssCtrlA就变成一个变量了,提示我未定义了!
我的代码
    '新增btn
Set aTool = modeAcBar.Bands("Ttools").Tools.Add(5, "TbtnAddnew")
aTool.ControlType = ddTTButton
aTool.Style = ddSIconText
aTool.Caption = "新增(&N)"
'aTool.ShortCuts = ssCtrlA
aTool.SetPicture index:=0, Picture:=MDIForms.ImageList1.ListImages("Addnew").Picture, Color:=&HC0C0C0
aTool.Visible = True
贝隆 2010-03-15
  • 打赏
  • 举报
回复
UPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUP
  • 打赏
  • 举报
回复
试试
Dim ctl As SSTool

Set ctl = SSActiveToolBars1.Tools.Add("K1")
ctl.Shortcut = ssCtrlA
Tiger_Zhao 2010-03-15
  • 打赏
  • 举报
回复
你用哪个 ActiveBar?
Tool 对象只有 ShortcutKey As Long 属性。
qpalzmn001 2010-03-15
  • 打赏
  • 举报
回复
上个贴标题搞错了,把ActiveBar和Spread搞晕了,再开提问。。。
内容概要:本文围绕城市场景下的无人机三维路径规划问题,提出了一种新颖的多目标粒子群优化算法(NMOPSO),旨在解决高维复杂环境中路径规划面临的多重挑战。研究聚焦于导航变量的多目标优化,构建了一个包含路径长度、飞行安全性、能量消耗等多个相互冲突目标的优化模型,并采用改进的粒子群算法进行高效搜索,最终获得一组Pareto最优解集,为实际决策提供多样化路径选择方案。该方法结合Matlab代码实现,详细阐述了算法的设计机制、数学建模流程及仿真验证过程,充分展示了其在密集城市建筑环境中有效规避障碍物、满足飞行动力学约束并实现多目标权衡的能力,具有较强的工程应用价值。; 适合人群:具备一定优化算法理论基础和Matlab编程能力,从事无人机路径规划、智能交通系统、自动化控制、人工智能应用等方向研究的研究生、科研人员及工程技术人员。; 使用场景及目标:①应用于城市环境中的无人机物流配送、巡检监控、应急救援等实际任务的三维路径规划;②为高维、非线性、多约束的多目标优化问题提供有效的算法设计思路与改进参考;③通过Matlab仿真平台复现算法,进一步开展性能测试、参数调优与算法对比研究,推动相关领域的技术创新。; 阅读建议:此资源强调算法原理与工程实践的深度融合,建议读者重点研读目标函数的构建方式、约束条件的处理策略以及NMOPSO算法的核心改进机制,并务必动手运行和调试所提供的Matlab代码,以深入理解算法在三维空间路径优化中的具体实现细节与实际表现。
内容概要:本文档围绕基于10机39节点的电力系统仿真展开,依托Matlab/Simulink平台构建标准电力系统模型,系统性地实现了电力系统稳态与暂态过程的仿真分析。内容涵盖潮流计算、短路故障、暂态稳定性、N-k故障分析、蓄意攻击与级联故障模拟等核心问题,并引入混合整数线性规划(MILP)等优化方法进行电网脆弱性评估与关键故障筛选。文档突出科研复现导向,整合了状态估计、虚假数据注入攻击、优化算法等前沿技术的交叉应用,具有较强的理论深度与工程实践价值。; 适合人群:具备电力系统基本理论知识和Matlab/Simulink仿真能力的研究生、科研人员及电力工程技术人员,特别适用于从事电力系统稳定性分析、安全防护、故障演化机制与优化调度等领域研究的专业人士。; 使用场景及目标:① 掌握10机39节点系统的建模方法与仿真流程;② 学习并复现电力系统典型故障(如短路、N-k故障、级联故障)的建模与动态响应分析;③ 理解基于MILP的电网脆弱性评估、攻击策略建模与故障传播机制;④ 结合优化算法开展电力系统安全防御、恢复策略与韧性提升研究。; 阅读建议:建议结合文档中标注的“顶级EI复现”“核心论文复现”等标签,重点关注模型构建逻辑与代码实现细节,优先运行仿真案例以理解其物理背景与数学建模原理,同时深入分析故障场景设定、目标函数设计及优化求解策略的工程意义与学术价值。

1,453

社区成员

发帖
与我相关
我的任务
社区描述
VB 控件
社区管理员
  • 控件
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧