[英]C# - Menu Strip Query
I have two questions regarding the windows form menu strip: 关于Windows窗体菜单栏,我有两个问题:
1. How to force the form to always show the helper keys? 1.如何强制表单始终显示帮助键? Currently the letter underlines are displayed only if the Alt key is pressed.
当前,仅在按下Alt键时显示字母下划线。
2. What is the command to cause a menu to drop down? 2.什么是导致菜单下拉的命令? Usually a menu drops down after the user clicks the menu button or navigates it with the keyboard, but I want to cause a menu to drop down by pressing an interface button and I can't figure out how to do it.
通常,在用户单击菜单按钮或使用键盘对其进行导航之后,菜单会下拉,但是我想通过按下界面按钮来使菜单下拉,但我不知道该怎么做。 I tried fiddling the DropDown property, but it didn't help.
我尝试摆弄DropDown属性,但没有帮助。
With ToolStripMenuItem there are three properties you need to look at: ShortcutKeyDisplayString ShortcutKeys ShowShortcutKeys 使用ToolStripMenuItem,您需要查看三个属性:ShortcutKeyDisplayString ShortcutKeys ShowShortcutKeys
The method you are looking for on ToolStripMenuItem is ShowDropDown() , executing this method will drop down the menu. 您在ToolStripMenuItem上寻找的方法是ShowDropDown() ,执行此方法将下拉菜单。
Example: 例:
((ToolStripMenuItem)FileMenu.Items[0]).ShowDropDown();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.