Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
SetAccessKey Method

AutomationProperties.SetAccessKey Method

Sets the value of the AutomationProperties.AccessKey attached property for the specified DependencyObject.

Namespace:  System.Windows.Automation
Assembly:  System.Windows (in System.Windows.dll)

public static void SetAccessKey(
	DependencyObject element,
	string value
)

Parameters

element
Type: System.Windows.DependencyObject
The DependencyObject for which to set the property.
value
Type: System.String
The access key value to set.

ExceptionCondition
ArgumentException

element is invalid value.

ArgumentNullException

element is null.

An access key (sometimes referred to as a keyboard shortcut or mnemonic) is a character in the text of a menu, menu item, or label of a control such as a button that invokes the associated menu function. For example, to provide a shortcut way to open the File menu (for which the access key is typically F), an element might have this attached property set to "ALT+F".

Important noteImportant Note:

Silverlight is generally hosted within a browser. The browser host might not report all possible key events to the Silverlight input system, often because the browser host might handle that key event itself. For details on this concept, see "Browser Hosts and Key Events" section of Keyboard Support.

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2015 Microsoft