Use of Accesstext hotkeys

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.