System.Windows.Forms.MenuItem.MergeMenu Method

Merges another menu item with this menu item.

Syntax

public void MergeMenu (MenuItem itemSrc)

Parameters

itemSrc
A System.Windows.Forms.MenuItem that specifies the menu item to merge with this one.

Remarks

Menu items are merged according to the value of the menu item's MenuItem.MergeType and MenuItem.MergeOrder properties. This version of the MenuItem.MergeMenu method enables you to merge two System.Windows.Forms.MenuItem objects (and their submenus) into a single menu. Menu merging is handled automatically when a Multiple Document Interface (MDI) parent form and a child both have menus. You can use this version of the method to merge two System.Windows.Forms.MenuItem objects (and their submenu items) located in a System.Windows.Forms.MainMenu control into a single menu within a System.Windows.Forms.ContextMenu. For example, you can call this version of the MenuItem.MergeMenu method to merge the menu items of a File and Edit menu into a single System.Windows.Forms.MenuItem that can then be added to and displayed by a System.Windows.Forms.ContextMenu.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0