Merges the MenuItem objects of one menu with the current menu.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Menu merging is typically done to merge the menus of a Multiple Document Interface (MDI) parent form with those of its active MDI child form. This is performed automatically by the .NET Framework common language runtime. For example, if an MDI parent form contains a set of menus for handling files and your MDI child form also has file-related menu items, the menu sets will automatically merge into a single file menu set when the child form is displayed in the MDI parent form.
You can use the method if you are merging two menu structures that are not part of an MDI application. This implementation can be called by the MainMenu or ContextMenu classes to merge two or more objects that derive from Menu.
This example creates two menus, mainMenu1 and mainMenu2. The first menu contains one MenuItem, File, and the second contains one MenuItem, Edit. Using the method, mainMenu2 is merged with mainMenu1. When displayed, mainMenu1 will contain the two menu items, File and Edit. This example requires that you have created a Form named Form1.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.