Export (0) Print
Expand All

AccessibleObject.KeyboardShortcut Property

Gets the shortcut key or access key for the accessible object.

[Visual Basic]
Public Overridable ReadOnly Property KeyboardShortcut As String
[C#]
public virtual string KeyboardShortcut {get;}
[C++]
public: __property virtual String* get_KeyboardShortcut();
[JScript]
public function get KeyboardShortcut() : String;

Property Value

The shortcut key or access key for the accessible object, or a null reference (Nothing in Visual Basic) if there is no shortcut key associated with the object.

Exceptions

Exception Type Condition
COMException The shortcut for the control cannot be retrieved.

Remarks

An access key, also known as a mnemonic, is an underlined character in the text of a menu, menu item, label of a button, or some other control. For example, a user can display a menu by pressing the ALT key while also pressing the indicated underlined key, such as ALT+F, to open the File menu. To use the access key of a menu item, the menu containing the item must be active. Controls such as toolbar buttons and menu items often have an associated shortcut key. A menu item can have both an access key and a shortcut key associated with it. If the value of the KeyboardShortcut property is a single character, you can assume it is an access key.

Notes to Inheritors:  All objects that have a shortcut key or access key should support this property.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

AccessibleObject Class | AccessibleObject Members | System.Windows.Forms Namespace | Bounds | DefaultAction | Description | Help | Name | Parent | Role | State | Value

Show:
© 2014 Microsoft