To create a new MDI application using a wizard:
- Choose FileNewOther to bring up the New Items dialog.
- Click on the Projects page and double-click MDI Application.
- Click OK.
MDI applications require more planning and are somewhat more complex to design than SDI applications. MDI applications spawn child windows that reside within the client window; the main form contains child forms. Set the FormStyle
property of the TForm
object to specify whether a form is a child (fsMDIChild
) or main form (fsMDIForm
). It is a good idea to define a base class for your child forms and derive each child form from this class, to avoid having to reset the child form's properties.
MDI applications often include a Window pop-up on the main menu that has items such as Cascade and Tile for viewing multiple windows in various styles. When a child window is minimized, its icon is located in the MDI parent form.
To create a new MDI application without using a wizard:
- Create the main window form or MDI parent window. Set its FormStyle property to fsMDIForm.
- Create a menu for the main window that includes FileOpen, FileSave, and Window which has Cascade, Tile, and Arrange All items.
- Create the MDI child forms and set their FormStyle properties to fsMDIChild.