Freigeben über


How to: Set Up Automatic Menu Merging for MDI Applications

The following procedure gives the basic steps for setting up automatic merging in a multiple-document interface (MDI) application with MenuStrip.

To set up automatic menu merging

  1. Create the MDI parent form by setting its IsMdiContainer property to true.

  2. Add a MenuStrip to the MDI parent, setting its MainMenuStrip property to that MenuStrip.

  3. Create an MDI child form, and set its MdiParent property to the name of the target form.

  4. Add a MenuStrip to the MDI child form.

  5. Set the Visible property of the target MenuStrip to false.

  6. Add menu items to the source MenuStrip that you want to merge into the target MenuStrip when the source is activated.

  7. Use the MergeAction property on the menu items in the source MenuStrip to control how they merge into the target form.

See Also

Reference

MenuStrip Control Overview (Windows Forms)
MenuStrip
ToolStripMenuItem