NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

MenuItem.MergeMenu (MenuItem)

Merges another menu item with this menu item.

[Visual Basic]
Overloads Shadows Public Sub MergeMenu( _
   ByVal itemSrc As MenuItem _
)
[C#]
public new void MergeMenu(
   MenuItem itemSrc
);
[C++]
public: new void MergeMenu(
   MenuItem* itemSrc
);
[JScript]
public new function MergeMenu(
   itemSrc : MenuItem
);

Parameters

itemSrc
[To be supplied.]

Remarks

Menu items are merged according to the value of menu item's MergeType and MergeOrder properties. This method is typically used to merge an MDI form's menu with that of its currently active MDI child form.

Example

The following example uses this version of the MergeMenu method to create a copy of a menu item and merge it with another. This example assumes that there are two menu items called MenuItem1 and MenuItem2 that contain submenu items within them and a MainMenu called MainMenu1 to display the menu items. MenuItem1 and MenuItem2 have different menu items contained within them. After the call to MergeMenu is made, a consolidated menu is created but MenuItem1's menu items are not changed.

Public Sub MergeMyMenus()
  ' Create a copy of my menu item.
  Dim TempMenuItem = New MenuItem()
  ' Create a copy of MenuItem1 before doing the merge
  TempMenuItem = MenuItem1.MergeMenu
  ' Merge MenuItem1's copy with MenuItem2
  MenuItem2.MergeMenu(TempMenuItem)
End Sub

See Also

MenuItem Class | MenuItem Members | System.WinForms Namespace | MenuItem.MergeMenu Overload List | Menu