RibbonControl.UnMerge Event

Allows you to perform additional customizations after another Ribbon Control has been unmerged from the current RibbonControl.

Namespace: DevExpress.XtraBars.Ribbon

Assembly: DevExpress.XtraBars.v21.2.dll


public event RibbonMergeEventHandler UnMerge

Event Data

The UnMerge event's data class is DevExpress.XtraBars.Ribbon.RibbonMergeEventArgs.


In MDI applications, Ribbon Controls of child and main MDI forms can be merged according to the RibbonControl.MdiMergeStyle property of the main Ribbon Control object. This property also determines when the unmerge mechanism is invoked, restoring the original layout of bar commands within the main and child Ribbon Controls. The UnMerge event fires after the main and child Ribbon Controls have been unmerged.

RibbonStatusBar objects within the main and child MDI forms are not merged automatically. To merge them, handle the RibbonControl.Merge event and call the RibbonStatusBar.MergeStatusBar methods. To unmerge them (restore the original layout of status bars), handle the UnMerge event and call the RibbonStatusBar.UnMergeStatusBar method.

See Ribbon Merging to learn more.


The following example shows how to merge RibbonStatusBar objects in an MDI application, when the Ribbon merging mechanism is invoked. It’s assumed that both the parent and child MDI forms contain RibbonStatusBar objects. To merge them, the RibbonStatusBar.MergeStatusBar method is called in a RibbonControl.Merge event handler. To unmerge the status bars, the RibbonStatusBar.UnMerge method is called in a RibbonControl.UnMerge event handler.

using DevExpress.XtraBars.Ribbon;

// Merge Ribbon Controls when a child form is maximized
RibbonControl1.MdiMergeStyle = DevExpress.XtraBars.Ribbon.RibbonMdiMergeStyle.OnlyWhenMaximized;

// Manually merge the status bars of the parent and child MDI forms.
private void RibbonControl1_Merge(object sender, RibbonMergeEventArgs e) {
    RibbonControl parentRRibbon = sender as RibbonControl;
    RibbonControl childRibbon = e.MergedChild;
// Manually unmerge the status bars.
private void RibbonControl1_UnMerge(object sender, RibbonMergeEventArgs e) {
    RibbonControl parentRRibbon = sender as RibbonControl;            
See Also