Programming Delphi How to Create a New SDI or MDI Application in Delphi or C++Builder
Notice: Undefined variable: relatedArticlesCount in /home/wwwroot/codeback.net/plugins/content/tags.php on line 149

Before tell the SDI and MDI applications, let us first look the interface models.

User interface models

Any form can be implemented as a multiple document interface (MDI) or single document interface (SDI) form. In an MDI application, more than one document or child window can be opened within a single parent window. This is common in applications such as spreadsheets or word processors. An SDI application, in contrast, normally contains a single document view. To make your form an SDI application, set the FormStyle property of your Form object to fsNormal.

For more information on developing the UI for an application, see Developing the application user interface.

SDI applications

To create a new SDI application:

1. Choose File|New|Other to bring up the New Items dialog.
2. Click on the Projects page and double-click SDI Application.
3. Click OK.

By default, the FormStyle property of your Form object is set to fsNormal, so Delphi or C++Builder assumes that all new applications are SDI applications.

MDI applications

To create a new MDI application:

1. Choose File|New|Other to bring up the New Items dialog.
2. Click on the Projects page and double-click MDI Application.
3. 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 summarize what you need to do to create the windows for the MDI application,

1. Create the main window form or MDI parent window. Set its FormStyle property to fsMDIForm.
2. Create a menu for the main window that includes File|Open, File|Save, and Window which has Cascade, Tile, and Arrange All items.
3. Create the MDI child forms and set their FormStyle properties to fsMDIChild.


Add comment


Security code
Refresh

Programming - Delphi