#303 – Define an Access Key for a Control Using an Underline

You define an access key for a control by including an underscore ‘_’ character immediately before the desired access key character in the control’s caption or label.  You can then use that character, in combination with the ALT key, to activate the control or give it focus.

Here are some examples:

        <Button Content="_Eggs" Width="100" Margin="10" Click="Button_Click"/>
        <CheckBox Content="_I'm hungry now" Margin="10" HorizontalAlignment="Center"/>
        <RadioButton Content="Pick _Me" Margin="10" HorizontalAlignment="Center"/>

About Sean
Software developer in the Twin Cities area, passionate about .NET technologies. Equally passionate about my own personal projects related to family history and preservation of family stories and photos.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: