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

qpalzmn001 2010-03-15 01:35:55
如题,我用aTool.ShortCuts = "Alt+N"提示 “对象 shortcuts 的方法 itool 失败”
请问我应该怎么添加,谢谢
...全文
247 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搞晕了,再开提问。。。
内容概要:本文提出并实现了一种基于Transform-KAN混合架构的电力负荷预测模型,旨在通过融合Transformer在长序列建模中的注意力机制优势与Kolmogorov-Arnold Network(KAN)在函数逼近方面的高精度非线性拟合能力,显著提升负荷预测的准确性与鲁棒性。研究系统阐述了模型的整体结构设计、输入特征工程、训练流程及关键超参数配置,并利用真实电力系统历史数据进行多步预测实验,验证了该方法在处理非线性、非平稳负荷序列时的优越性能。重点探讨了新型神经网络结构在时间序列预测任务中的创新应用,为复杂电力系统负荷的精准预估提供了有效的技术路径。; 适合人群:具备一定编程基础和机器学习知识,从事电力系统、能源管理或时间序列预测相关研究的研发人员,尤其适合工作1-3年希望深入理解前沿预测模型的技术人员。; 使用场景及目标:①应用于电网调度、能源管理系统中对未来电力负荷的精确预测;②探索Transformer与KAN等新兴神经网络模型在实际工业场景中的融合设计与实现方法;③为学术研究提供可复现的高性能负荷预测基准方案。; 阅读建议:此资源以Python代码实现为核心,强调理论与实践相结合,建议读者在学习过程中仔细研读模型架构细节,动手运行并调试代码,结合实验结果深入理解各模块的作用与优化策略,从而全面掌握该先进预测方法的设计精髓。

1,453

社区成员

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

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