开发者

WPF Underline a letter in a label element

开发者 https://www.devze.com 2023-01-03 22:04 出处:网络
I have a label next to a text box whic开发者_开发知识库h has a short cut key. The XAML for the label looks like:

I have a label next to a text box whic开发者_开发知识库h 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!


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".

0

精彩评论

暂无评论...
验证码 换一张
取 消