Command.ShortcutKey
- Updated2025-07-21
- 1 minute(s) read
Command.ShortcutKey
Syntax
Command.ShortcutKey
Data Type
Purpose
Specifies which shortcut key to assign to a user interface element that represents a command.
Remarks
Use the Command.ShortcutModifier property to specify <Shift>, <Ctrl>, and <Alt> modifiers for the shortcut key. For example, to assign the shortcut Ctrl+F12 to the command, set this property to ShortcutKey_VK_F12 and set the Command.ShortcutModifier property to ShortcutModifier_Control .
The command computes the value of this property according to the kind of command and the current state of the items to which the command applies. However, when you set this property, the command returns only the property values you set for the remainder of the life of the Command object.