All docs
V21.2
21.2
21.1
20.2
20.1
19.2
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

ToolbarFormControl.UnMerge Event

Fires after title bars are unmerged.

Namespace: DevExpress.XtraBars.ToolbarForm

Assembly: DevExpress.XtraBars.v21.2.dll

Declaration

[DXCategory("Merge")]
public event ToolbarFormMergeEventHandler UnMerge

Event Data

The UnMerge event's data class is ToolbarFormMergeEventArgs. The following properties provide information specific to this event:

Property Description
MergedChild Provides access to the child form’s title bar.
MergeOwner Provides access to the parent form’s title bar.

Remarks

In an MDI application, when a child toolbar form is maximized, its bar items in the title bar are merged with the parent form’s bar items. Use the MdiMergeStyle property to specify whether bar items are merged when a child form is maximized, focused, or never merged.

The parent and child title bars fire the Merge and UnMerge events after the bar items are merged.

Example

If the parent form and a child form contain bar items with equal captions (for example, File), you can remove the duplicated command from the merged title bar as the code below demonstrates.

private void ToolbarFormControl1_Merge(object sender, DevExpress.XtraBars.ToolbarForm.ToolbarFormMergeEventArgs e) {
    e.MergeOwner.TitleItemLinks
        .GroupBy(x => x.Caption)
        .Where(x => x.Count() > 1)
        .ForEach(x => x
        .ForEach(y => {
            if (e.MergedChild.TitleItemLinks.Where(z => z.Item == y.Item).Count() != 0)
                y.Visible = false;
        }));
}
See Also