BarItem.ItemShortcut Property

Gets or sets the shortcut used to access associated links using the keyboard.

Namespace: DevExpress.XtraBars

Assembly: DevExpress.XtraBars.v21.1.dll


public virtual BarShortcut ItemShortcut { get; set; }

Property Value

Type Description

A BarShortcut object specifying the key combination used to access links associated with this item.


You can respond to link clicks by handling the BarItem.ItemClick or BarManager.ItemClick event. The same events are raised when you press the ItemShortcut key combination.

Bar items do not appear depressed when a user presses shortcuts. Shortcuts cannot be used to expand sub-menus.

At design time, use the combo box available for the ItemShortcut property in the Visual Studio Property Grid to select one of the predefined shortcuts. Choose (custom) to invoke the custom shortcut editor.


Up to two successive combinations can be specified. For instance, you can specify the “CTRL+J, CTRL+K” shortcut for an item. Note that in this case, you cannot use the first combination (“CTRL+J”) alone for another item.

At runtime, you can specify a shortcut as follows:

barButtonItem1.ItemShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.M));
barButtonItem2.ItemShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.J), (System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.K));

The text representation of item shortcuts is displayed for items when they are embedded in a popup menu or sub-menu, and the menu’s MenuDrawMode property is set to SmallImagesText.

To provide a custom display string for the assigned shortcut, use the BarItem.ShortcutKeyDisplayString property.


Do not assign system shortcuts to bar items. For instance, the Ctrl+A shortcut is used to select text in a text box. The Ctrl+C shortcut is used to copy the selected text. The Esc shortcut is used to close dropdown windows. Do not assign these shortcuts and such to bar items. Otherwise, conflicts and unpredictable results may occur.

See Also