在winform中为menuitem提供键盘快捷键 [英] Giving the keyboard shortcut for menuitem in winform

查看:83
本文介绍了在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

推荐答案

如果您查看菜单项,则它们具有属性
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

使用C#进行Windows窗体编程-第3章:菜单 [

Windows Forms Programming with C# - Chapter 3: Menus[^]


这篇关于在winform中为menuitem提供键盘快捷键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆