使用键盘选择菜单项 [英] Use keyboard for selecting menu items

查看:102
本文介绍了使用键盘选择菜单项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用键盘在vb.net中选择菜单项.
所有菜单项都可以通过键盘使用.请发送代码.

我想通过键盘选择菜单项....

Use keyboard for selecting menu items in vb.net.
All the menu item may use through keyboard. please sending the code.

i want to selecting menu items totatly through keyboard....

推荐答案

两种方法可以做到:
1)在您要用户用作热键的字符前面放置一个&"字符.这将在该字符下划线,并允许[ALT] +键打开菜单,并在菜单打开后激活键.
&File"-[ALT​​] + F打开文件菜单.
...&Save"-S将保存文件.

2)突出显示设计器中的菜单项.使用ShortcutKeys属性.这将在当前表单中提供一个热键来激活菜单项.


按钮文本中的&"具有相同的效果.

还有一种将[ALT] +组合键用于非按钮项目的形式:
1)在标签上按制表符顺序放置一个标签(VS中有菜单按钮以显示/更改制表符顺序).
2)如上使用&"字符.
Two ways to do it:
1) Place an ''&'' character in front of the character you want the user to use as a hot-key. This will underline that character, and allow [ALT]+ Key to open the menu, and Key to activate once the menu is open.
"&File" - [ALT]+F opens the file menu.
..."&Save" - S will save the file.

2) Highlight the menu item in the designer. Use the ShortcutKeys property. This will provide a hot key within the current form to activate the menu item.


''&'' in a button text has the same effect.

There is also a way to use [ALT] + key combinations within the form for non-button items:
1) Place a label immediately before the control in the tab order (there is menu button in VS to show / change the tab order).
2) Use the ''&'' character as above.


这篇关于使用键盘选择菜单项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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