WPF Underline a letter in a label element

隐身守侯 提交于 2020-01-03 21:32:57

问题


I have a label next to a text box which has a short cut key. The XAML for the label looks like:

<Label>Enter your _Name</Label>

Where if you press alt+N it sets focus in the textbox where you would enter your name.

I'd like the letter N to be underlined so that when the user sees the label it looks like:

Enter your Name (well N is bold here, but I'd like it be underlined :))

Thanks for your help!


回答1:


The N will automatically be underlined when the Alt key is pressed. You'll see this behavior in any Windows application as it's a system-wide setting.

If you want to always get the underline without having to press Alt, go to the Ease of Access center in the control panel and check "underline keyboard shortcuts and access keys".



来源:https://stackoverflow.com/questions/3056008/wpf-underline-a-letter-in-a-label-element

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!