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 parent form.

  4. Add a MenuStrip to the MDI child form.

  5. On the child form, set the Visible property of the MenuStrip to false.

  6. Add menu items to the child form's MenuStrip that you want to merge into the parent form's MenuStrip when the child form is activated.

  7. Use the MergeAction property on the menu items in the child form's MenuStrip to control how they merge into the parent form.

See Also

MenuStrip Control Overview