如何在加载应用程序时按下 Alt 键?
如何在 vb.net winforms 应用程序中加载表单时执行更改按键操作?
意味着当执行表单(devExpress 的 Xtraform)加载事件时,必须按编程方式按下 alt 键。 是否可以?如果是,请建议一些代码。
谢谢。
how to perform alter key press at the time of form loading in vb.net winforms application?
Means when the form's(devExpress's Xtraform) load event is executed that time alt key must be pressed pro-grammatically .
Is it possible? If yes please suggest some code.
thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想澄清一下我们的控制是如何工作的。事实上,您谈论的不是按钮的快捷键,而是加速键,如果按下 Alt+AnyKey,加速键会激活按钮的操作。要定义此加速键,请在按钮的
Text
属性中包含&
符号。在 2000 年以来的所有 Windows 版本中,默认行为是隐藏键盘加速器,这意味着您不会在控件的标题中看到此下划线。此下划线仅在按下 Alt 键时可见。如果您希望此效果始终可见,则需要调整 MS Windows 本身的设置,如下所述:
始终显示菜单下划线(键盘加速器)
但是,请注意,即使下划线不可见,键盘加速器仍然有效。用户可以随时按 Alt+AnyKey 来触发相应的命令。
I would like to clarify how our controls work. In fact, you are talking not about button's shortcuts, but accelerator keys which activate a button's action if the Alt+AnyKey is pressed. To define this accelerator key, the
&
symbol is included in the button'sText
property.On all versions of Windows since 2000, the default behavior is to hide the keyboard accelerators, meaning that you won't see this underline in the control's caption. This underlining is only visible when the Alt key is pressed. If you want that this effect to be always visible, it is necessary to adjust a setting in MS Windows itself, as explained here:
Always show menu underline (keyboard accelerators)
However, note that the keyboard accelerators will still work, even when the underlines are not visible. The user can trigger the appropriate command by pressing Alt+AnyKey at any time.
在表单加载部分使用
问题解决了!
Use in the form load section
Problem solved!