MDI Applications
Go Up to GUI Applications
To create a new MDI application using a wizard:
- Click File > New > Other to bring up the New Items dialog.
- Choose the Windows folder from the Delphi or C++ Builder dropdowns.
- Select MDI Application and 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:
- File > Open
- File > Save
- Window, with Cascade, Tile, and Arrange All items
- Create the MDI child forms and set their FormStyle properties to fsMDIChild.
The MDI child forms have a flat border under Windows 10 and 11 systems, which uses fixed default system colors compatible with clBtnFace color.
To disable handling the child window borders, you can use the global setting ChangeChildFormSystemBorder.