Skip to main content
Bar

BarShortcut Class

Contains item shortcut settings.

Namespace: DevExpress.XtraBars

Assembly: DevExpress.XtraBars.v23.2.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public class BarShortcut :
    IEquatable<BarShortcut>

The following members return BarShortcut objects:

Remarks

You can assign a shortcut to an item using its BarItem.ItemShortcut property (this property is of the BarShortcut type).

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.

The BarItem.ItemShortcut property provides a shortcut selector at design time

BarItem.ItemShortcut

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));

Note

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 a 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.

Inheritance

Object
BarShortcut
See Also