MDI Parent Form in Visual Studio 2008 using VB.NET

In this article you will learn how to Create a MDI Parent Form in VS 2008.
  • 4633
Download Files:
 
Multiple-Document Interface (MDI) application is the MDI parent form. MDI applications must have at least two forms, the parent form and one or more child forms. In MDI you can make many child forms but only one parent Form.The Parent form is the MDI Form because its contains all child forms.

How To create an MDI parent form at design time
  1. Create a Windows Application project.
     
    • Start Visual Studio 2010.
       
    • On the File menu, Select new Project.
       
    • The New Project dialog box will come.
       
    • In the Installed Templates pane, Select Visual Basic, and then select Windows.
       
    • Above the middle pane, select the target framework from the drop-down list.
       
    • In the middle pane, select the Windows Forms Application template.
       
    • In the Name text box, specify a name for the project like MDI Form.
       
    • In the Location text box, specify a folder to save the project.
       
    • Click OK.
       
  2. In the Properties window, set the ISMDIContainer property to true.

    14.gif
     

    This designates the form as an MDI container for child windows.
     

  3. From the Toolbox, drag aMenuStrip component to the form. Create a top-level menu item with the Text property set to &File with submenu items calledNew, open, save and &Close.

    15.gif

    And create a top-level menu item called Window and sub menu items called New Window, Open Window .

    16.gif
     

    The first menu will create and hide menu items at run time, and the second menu will keep track of the open MDI child windows. At this point, you have created an MDI parent window.  
     

  4. Press F5 to run the application.

    17.gif

    In next article I will discuss about how to create MDI child forms.

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.