RibbonControl.ShowCustomizationMenu Event

Occurs before the RibbonControl's Customization Menu is displayed.

Namespace: DevExpress.XtraBars.Ribbon

Assembly: DevExpress.XtraBars.v20.1.dll


public event RibbonCustomizationMenuEventHandler ShowCustomizationMenu
Public Event ShowCustomizationMenu As RibbonCustomizationMenuEventHandler

Event Data

The ShowCustomizationMenu event's data class is DevExpress.XtraBars.Ribbon.RibbonCustomizationMenuEventArgs.


The Customization Menu is displayed when a Ribbon Control is right-clicked. You can handle the ShowCustomizationMenu event to customize the menu or prevent it from being displayed.

The customization menu is not recreated each time it needs to be displayed. Therefore, if the menu has been modified in the ShowCustomizationMenu event handler, the changes will persist the next time the ShowCustomizationMenu event fires. So, before modifying the menu, you generally need to check whether modifications have been already made or not.


The following example demonstrates how to customize a RibbonControl's Customization Menu. The RibbonControl.ShowCustomizationMenu event is handled to add a custom About menu item.

The result is illustrated below:


using DevExpress.XtraBars;
using DevExpress.XtraBars.Ribbon;

// The item to be added to the Customization Menu
BarItem biAbout;
// Initialize the item and add it to the RibbonControl's item collection.
private void Form1_Load(object sender, EventArgs e) {
    biAbout = new BarButtonItem();
    biAbout.Caption = "About";
    biAbout.ItemClick += new ItemClickEventHandler(biAbout_ItemClick);
// The method invoked when the item is clicked.
void biAbout_ItemClick(object sender, ItemClickEventArgs e) {

BarItemLink biAboutLink = null;
// Add the item to the Customization Menu.
private void RibbonControl1_ShowCustomizationMenu(object sender, 
  RibbonCustomizationMenuEventArgs e) {
    if (biAboutLink == null) {
        biAboutLink = e.CustomizationMenu.AddItem(biAbout);
See Also