Back to Devexpress

BarShortcut Class

windowsforms-devexpress-dot-xtrabars-d779d5e2.md

latest3.3 KB
Original Source

BarShortcut Class

Contains item shortcut settings.

Namespace : DevExpress.XtraBars

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public class BarShortcut :
    IEquatable<BarShortcut>
vb
Public Class BarShortcut
    Implements IEquatable(Of 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

At runtime, you can specify a shortcut as follows:

csharp
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));
vb
BarButtonItem1.ItemShortcut = New DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.M))
BarButtonItem2.ItemShortcut = New DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.J), (System.Windows.Forms.Keys.Control Or 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

BarShortcut Members

ItemShortcut

DevExpress.XtraBars Namespace