Skip to main content

TdxBarManager.OnMerge Event

Fires when one of the MDI child forms changes its state.

Declaration

property OnMerge: TdxBarMergeEvent read; write;

Remarks

When a child form changes its state (it’s activated, for instance), its bar items are added by default from a child form to the parent form. To add child bar items to parent bars in a specific manner, handle the OnMerge event. For instance, you can prohibit certain bars from adding to parent bars or insert items to arbitrary positions within parent bars.

The Sender parameter references the bar manager of the MDI parent form.

The ChildBarManager parameter references the bar manager of the MDI child form.

AddItems indicates the operation being performed. Since the OnMerge event fires for the complementary states, it’s important to know which action is currently running.

The AddItems parameter returns True, if the current MDI child form is activated or maximized. For these actions, the merge operation can be performed.

The AddItems parameter returns False, if the child form is deactivated, restored or minimized. These states are opposite to the ones above, and therefore the bars should be unmerged.

You can handle the OnBeforeMerge and OnAfterMerge events to update form elements in response to the operations you perform in the OnMerge and OnMenuMerge event handlers.

Note

If the OnMerge event handler is assigned, the parent form’s bar manager does not automatically merge child and parent bars. The OnMenuMerge event is fired before the OnMerge event and only when the AlwaysMerge property is set to True.

See Also