#303 – Define an Access Key for a Control Using an Underline
May 19, 2011 1 Comment
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"/>
And how can I define an access key, if the content comes from a (resource) .resx file (something like Content=”{Binding BtnStart}”