在winform中为menuitem提供键盘快捷键 [英] Giving the keyboard shortcut for menuitem in winform
本文介绍了在winform中为menuitem提供键盘快捷键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我正在Windows Form C#应用程序上工作.我需要键盘快捷键才能访问菜单.如果我按Enter键,如果我在一个文本字段中,则应转到下一个字段(=以按Tab键);如果按Enter键,则应转到下一个字段.我该如何实现这些..
在此先感谢
Hi All,
Am working on windows form C# application .Am added the menu trip and menu items . I need keyboard shortcut for accessing the menu . IF i hit enter Key, it should go to next field ( = to pressing tab) if i am in one text field, if i hit enter, it should go to next..How can i achieve these..
thanks in advance
推荐答案
如果您查看菜单项,则它们具有属性 ^ ]这将(可预测地)设置键盘快捷键...
至于Enter键,请不要.
这是对Enter键预期行为的重大更改-它已经我完成了-取消此对话框",这只会使用户感到困惑.强烈建议您不要更改一个应用程序的正常预期行为-它会使用户感到困惑和烦恼,并且通常会使用户更不愿意使用您的应用程序.
If you look at your menu items, they have a property ShortcutKeys[^] which will (predictably) set the keyboard shortcut...
As for the Enter key, please don''t.
This is a major change to the expected behaviour of the Enter key - that it is "I''ve finished - take this dialog away" which can only confuse users. It is strongly recommended that you do not change normal expected behaviour for one app - it confuses and annoys users and will normally make users more reluctant to use your application.
您可以访问此网站
Hello You can refer this website
Windows Forms Programming with C# - Chapter 3: Menus[^]
这篇关于在winform中为menuitem提供键盘快捷键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文