Skip to main content
Bar

BarLinkContainerItem.Merge(BarLinkContainerItem) Method

Adds the subitems of the specified container item to the current container item.

Namespace: DevExpress.XtraBars

Assembly: DevExpress.XtraBars.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public void Merge(
    BarLinkContainerItem item
)

Parameters

Name Type Description
item BarLinkContainerItem

A container item whose subitems are added to the current container item. The types of the two container items should be identical. In addition, the container items must belong to different BarManagers.

Remarks

XtraBars support automatic merging/unmerging of main menus. This means that if the parent and child MDI forms have main menus, they will be combined within the parent’s main menu when the merge mechanism is invoked. Other bars can be combined only manually by handling the Merge event.

The merging mechanism invokes the Merge event according to the BarManager.MdiMenuMergeStyle property of the parent form’s BarManager.

To merge bars via the Merge event, use the Bar.Merge method.

If the bars being merged have container items (submenus, for instance) this method will try to merge them as well. Two container items will be merged if the following conditions are met:

The original and acquired subitems are arranged within the container item according to their BarItem.MergeOrder property values.

The BarLinkContainerItem.UnMerge method restores the original item layout for the container item after a merging operation.

Note

If bar items are created at design time and the Merge method should be called when the form is being loaded, the BarManager.ForceInitialize method must be called beforehand.

See the MDI Merging topic for more information.

See Also