Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 .Net 3.5 windows 窗体应用程序,其中一些图标下方有一系列标签控件。这些标签由 Ctrl + [带下划线的字母](不是 Alt+Key)触发。我想在标签中加下划线而不将其设为热键。我尝试劫持绘画事件,但我不知道如何居中对齐文本(标签在其图标下方居中对齐)和/或绘制下划线。
转到关卡属性并找到 Text 属性。在您要下划线的字母前添加一个“&”。例如
[1]: http://i.stack.imgur.com/AsC5T.png
或者您可以通过添加以下行来执行此表单代码
this.label1.Text = "Add &Bank";