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

qpalzmn001 2010-03-15 01:35:55
如题,我用aTool.ShortCuts = "Alt+N"提示 “对象 shortcuts 的方法 itool 失败”
请问我应该怎么添加,谢谢
...全文
237 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搞晕了,再开提问。。。
内容概要:本文档系统讲解了创意版烟花的完整实现路径,从粒子系统原理出发,深入剖析烟花效果的五大核心阶段——上升、爆炸、扩散、衰减与拖尾,并基于四种技术栈(HTML5 Canvas、Three.js、Python Pygame、AI音乐节拍同步)提供可运行的完整代码方案。文档涵盖基础实现、视觉增强(形状变化、闪烁、二次爆炸)、交互升级(鼠标拖动、手势控制)、性能优化(对象池、渲染优化)、部署上线(GitHub Pages、Vercel)及创意拓展(文字烟花、数据可视化、协同互动),形成“原理→编码→调优→部署→创新”的闭环学习链路。同时融入Web Audio API节拍检测、滑动窗口动态阈值等实用算法,助力开发者打造兼具美观性与技术深度的动态视觉作品。; 适合人群:具备基础编程能力的前端开发者、Python爱好者、多媒体交互设计人员,以及希望提升图形编程与动效设计能力的工作1-3年研发人员;也适用于教学演示、作品集建设或创意项目原型开发。; 使用场景及目标:①掌握粒子系统在动画与游戏开发中的底层实现机制;②实现网页端与桌面端的高性能烟花特效;③构建音乐可视化、数据艺术、互动装置等融合型项目;④学习从代码实现到线上部署的全流程工程实践。; 阅读建议:建议按照“Canvas基础→进阶优化→3D/Pygame/AI扩展”的路径逐步实践,重点关注参数调优表与性能优化策略,在调试中理解每行代码的作用;对于音乐同步等复杂功能,可先运行成功案例再深入算法逻辑,结合实际项目需求灵活组合各项技术模块。

1,453

社区成员

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

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