#840 – Access Keys Should Be Unique within A Window

An access key is a character that the user can press, in combination with the Alt key, in order to activate or give a control focus.  Because a user’s key press is associated with a particular control, you should ensure that each access key is unique within the parent window.

If you do happen to define the same access key for multiple controls within a window, pressing the access key will toggle the focus between the controls, rather than activating them.  In the example below, press Alt+T will toggle the focus back and forth between the two buttons.  If you then change the second access key to something different, pressing Alt+T will activate (press) the first button.

        <Button Content="_This" VerticalAlignment="Top"
                Padding="10,5" Margin="5"
                Click="DoThis_Click"/>
        <Button Content="_That" VerticalAlignment="Top"
                Padding="10,5" Margin="5"
                Click="DoThat_Click"/>

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.

One Response to #840 – Access Keys Should Be Unique within A Window

  1. Pingback: Dew Drop – June 12, 2013 (#1,566) | Alvin Ashcraft's Morning Dew

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: