ToolStrip快捷方式问题. [英] ToolStrip Shortcut Question.
本文介绍了ToolStrip快捷方式问题.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
TextBox控件中的ToolStrip可以添加执行此操作的快捷方式吗?
ToolStrip in the TextBox control, can add a shortcut way to do this?
推荐答案
通常,当我想向不添加快捷键的控件添加没有快捷键属性,我可以这样做:
-将菜单栏添加到表单中,使其对false的可见性
-将菜单项添加到菜单栏中,并分配我所需的快捷键
-在菜单项的click事件中,调用与快捷键相关联的事件处理程序
这是一种回旋的方式,但是可以.
希望这会有所帮助.
Generally when I want to add a shortcut key to a control that doesn''t have the shortcut key property I do this:
- Add a Menu Strip to the form, with it''s visibility to false
- Add a Menu Item to the Menu Strip with my desired shortcut key assigned
- In the menu item''s click event call the event handler for the whatever you would have tied the shortcut key too
It''s kind of a roundabout way to do it, but it works.
Hope this helps.
这篇关于ToolStrip快捷方式问题.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文