This class provides both functional and visual support for access keys (also known as mnemonics). It is frequently used to enable quick keyboard access to controls such as a TextBox. To assign a Label to a Control, set the Target property to the control that should get focus when the user presses the access key. Setting the target also causes Microsoft UI Automation to use the text of the label as the name of the targeted control. For more information, see Accessibility.
To set the access key, add an underscore before the character that should be the access key. If your content has multiple underscore characters, only the first one is converted into an access key; the other underscores appear as normal text. If the underscore that you want converted to the access key is not the first underscore, use two consecutive underscores for any underscores that precede the one that you want to convert. For example, the following code contains an access key and displays as _HelloWorld:
|
<Label>__Hello_World</Label>
|
Because the underscore that precedes H is a double, the W key registers as the access key.
A label is not focusable, and it is not a tab stop. For details, see Focus Overview.
Content Model: Label is a ContentControl. Its content property is Content. For more information on the content model for Label, see Controls Content Model Overview.