简体   繁体   English

vb.net带有&热键的按钮文本

[英]vb.net Button Text with the & hot key

I have a button on a form and am using the & before a character in the text property to make it a hot key accessible with the ctrl key. 我在表单上有一个按钮,并且在text属性中的字符前使用&,使其成为可通过ctrl键访问的热键。 My problem is that when I start the program, the underline does not appear until the user presses the ctrl key. 我的问题是,当我启动程序时,在用户按下ctrl键之前,不会出现下划线。 How do I make the underline display when the program starts? 程序启动时如何显示下划线?

Thanks 谢谢

Windows doesn't show the underline until the user presses the Alt key. 在用户按下Alt键之前,Windows不会显示下划线。 It's standard Windows behaviour. 这是Windows的标准行为。 Try pressing Alt-F in Notepad and look at the File menu caption. 尝试在记事本中按Alt-F,然后查看“文件”菜单标题。 The user can change this behaviour in their Windows settings. 用户可以在Windows设置中更改此行为。 I think it's best to respect the normal Windows behaviour. 我认为最好尊重正常的Windows行为。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM