Back to Devexpress

RibbonControl.CustomizeQatMenu Event

windowsforms-devexpress-dot-xtrabars-dot-ribbon-dot-ribboncontrol-9033b923.md

latest2.8 KB
Original Source

RibbonControl.CustomizeQatMenu Event

Fires when the Quick Access Toolbar customization menu is about to be displayed, allowing commands in the menu to be customized.

Namespace : DevExpress.XtraBars.Ribbon

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DXCategory("Events")]
public event CustomizeQatMenuEventHandler CustomizeQatMenu
vb
<DXCategory("Events")>
Public Event CustomizeQatMenu As CustomizeQatMenuEventHandler

Event Data

The CustomizeQatMenu event's data class is DevExpress.XtraBars.Ribbon.CustomizeQatMenuEventArgs.

Remarks

The CustomizeQatMenu event fires when an end-user invokes the customization menu of the Quick Access Toolbar. The ItemLinks property of the CustomizeQatMenuEventArgs object, passed to the event handler as a parameter, provides access to the collection of commands (item links) to be displayed in the customization menu.

This event allows you, for instance, to set the BarItemLink.Visible property of an item link to false to hide a particular command from the customization menu. The following sample event handler shows how to hide the command captioned Exit from the customization menu.

csharp
private void ribbon_CustomizeQatMenu(object sender, DevExpress.XtraBars.Ribbon.CustomizeQatMenuEventArgs e) {
    for (int i = 0; i < e.ItemLinks.Count; i++) {
        if (e.ItemLinks[i].Item.Caption == "Exit") {
            e.ItemLinks[i].Visible = false;
            break;
        }
    }
}
vb
Private Sub ribbon_CustomizeQatMenu(sender As Object, e As DevExpress.XtraBars.Ribbon.CustomizeQatMenuEventArgs)
    For i As Integer = 0 To e.ItemLinks.Count - 1
        If e.ItemLinks(i).Item.Caption = "Exit" Then
            e.ItemLinks(i).Visible = False
            Exit For
        End If
    Next
End Sub

See Also

Toolbar

ShowQatLocationSelector

Quick Access Toolbar

RibbonControl Class

RibbonControl Members

DevExpress.XtraBars.Ribbon Namespace