Accesstext can be used to bind a hotkey to another control (often used in a TextBox) or to set a hotkey for another control individually
1. You can use Accesstext in the label
Code:
<label horizontalalignment= "left" name= "Label1" target= "{Binding elementname=textbox1}" margin= "70,185,0,206" Width= "164" >
<Label.Content>
<TextBlock>
<AccessText>
User name (_u):
</AccessText>
</TextBlock>
</Label.Content>
</Label>
<textbox height= "horizontalalignment=" "left" margin= "141,185,0,0" name= "TextBox1" verticalalignment= "Top" Width= "/>"
where {Binding Elementname=textbox1} is used to bind a label to a TextBox, TextBox1 gets the focus when the label touches the hot key.
Hotkey Trigger mode: ALT + Hotkey (one character after underscore) This example: The hotkey of the user name (_u) is U
If the label in the Accesstext, TextBlock Delete, or even delete the label.content, the effect is the same:
<label horizontalalignment= "left" name= "Label1" target= "{Binding elementname=textbox1}" margin= "70,185,0,206" Width= "164" >
User name (_u):
</Label>
I'm guessing it's automatically added Accesstext, which is just my estimate, and I hope you'll correct me.
2. You can add Accesstext to other controls
Code:
<button height= "horizontalalignment=" "left" margin= "208,15,0,0" Name= "button1" verticalalignment= "Top" Width= " "click=" > "Button1_Click"
<Button.Content>
<AccessText>
_button
</AccessText>
</Button.Content>
</Button>
This allows the button's click event to be triggered when the alt+b is pressed
Use of Accesstext hotkeys