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
- 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 C#,
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.
- In the Properties window, set the ISMDIContainer property to true.
This designates the form as an MDI container for child windows.
- From the Toolbox, drag a
MenuStrip component to the form. Create a
top-level menu item with the Text property
set to &File with submenu items called
New, open, save and &Close.
And create a top-level menu item called Window and
sub menu items called New Window, Open Window .
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.
- Press F5 to
run the application.
In next article I will discuss about how to create MDI child forms.