Skip to main content

RibbonStatusBar.UnMergeStatusBar() Method

Restores the bar commands layout within the current RibbonStatusBar object after another RibbonStatusBar object has been merged into it.

Namespace: DevExpress.XtraBars.Ribbon

Assembly: DevExpress.XtraBars.v23.2.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public virtual void UnMergeStatusBar()

Remarks

RibbonStatusBar objects can be merged via the RibbonStatusBar.MergeStatusBar method. The UnMergeStatusBar method allows the status bars to be unmerged. This method restores the original layout of bar commands within the current RibbonStatusBar object. To unmerge RibbonStatusBar objects when the standard unmerge mechnism is invoked, handle the RibbonControl.UnMerge event.

After RibbonStatusBar objects have been unmerged, the RibbonStatusBar.UnMerge event fires.

See Ribbon Merging to learn more.

Example

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;
    parentRRibbon.StatusBar.MergeStatusBar(childRibbon.StatusBar);
}
// Manually unmerge the status bars.
private void RibbonControl1_UnMerge(object sender, RibbonMergeEventArgs e) {
    RibbonControl parentRRibbon = sender as RibbonControl;            
    parentRRibbon.StatusBar.UnMergeStatusBar();
}
See Also