AcceleratorKey attached property
Collapse the table of content
Expand the table of content

AutomationProperties.AcceleratorKey attached property

Gets or sets the accelerator key for the specified element.

<object AutomationProperties.AcceleratorKey="stringForKey" />

XAML Values


The accelerator key string for the element.


When getting this property in code, use GetAcceleratorKey. When setting this property in code, use SetAcceleratorKey.

If an application responds to keyboard events to provide shortcut key behavior, it should return a string that contains the keyboard shortcut combination. For example, for an element that can copy text to the clipboard, this attached property might be set to the value "CTRL+ALT+C". The "+" sign is commonly used to denote the combination of keys. AutomationProperties.AcceleratorKey reports the information as a string, but setting the string does not result in any logic. The actual key handling is done by writing a handler for KeyDown or KeyUp on the control class, or in some cases by overriding any existing OnKeyDown or OnKeyUp from base classes. Control implementations might already implement accelerator key behavior. If you are consuming a third party control, you might need to consult available documentation for that control to determine whether there is existing key handling when you use a control instance in your application.

Requirements (Windows 10 device family)

Device family

API contract




Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]





See also




© 2018 Microsoft