AccessibleObject.KeyboardShortcut AccessibleObject.KeyboardShortcut AccessibleObject.KeyboardShortcut AccessibleObject.KeyboardShortcut Property

定义

获取辅助性对象的快捷键或访问键。Gets the shortcut key or access key for the accessible object.

public:
 virtual property System::String ^ KeyboardShortcut { System::String ^ get(); };
public virtual string KeyboardShortcut { get; }
member this.KeyboardShortcut : string
Public Overridable ReadOnly Property KeyboardShortcut As String

属性值

辅助性对象的快捷键或访问键,或者,如果没有与此对象相关联的快捷键,则是 nullThe shortcut key or access key for the accessible object, or null if there is no shortcut key associated with the object.

异常

无法检索控件的快捷方式。The shortcut for the control cannot be retrieved.

注解

访问键 (也称为助记键) 是菜单、菜单项、按钮标签或其他控件的文本中带下划线的字符。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. 例如, 用户可以按 alt 键显示菜单, 同时按指示的带下划线键 (如 ALT + F) 打开File菜单。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. 如果该KeyboardShortcut属性的值是单个字符, 则可以假定它是一个访问键。If the value of the KeyboardShortcut property is a single character, you can assume it is an access key.

继承者说明

具有快捷键或访问键的所有对象都应支持此属性。All objects that have a shortcut key or access key should support this property.

适用于

另请参阅