Design of MDI application in C + + Builder

Source: Internet
Author: User

An MDI (multiple-document interface) application means that a user can open several documents at the same time, and each document appears in a separate window in the client area of the main window of the application. Like word processor word is a typical MDI application, you can open and use multiple documents in Word, you can also create and open multiple slide applications in PowerPoint, and the spreadsheet allows users to edit multiple charts at the same time. MDI applications typically include three types of Windows:

* frame window: The frame window is similar to the main window of the application, with a resizable border, title bar, System menu, and so on. The application must register a window class for the frame window. An MDI application typically has only one frame window, and the frame window controls other types of Windows.

* Customer window: Client window provides management of subordinate MDI child windows, each MDI application has a client window.

* child window: When a user opens or creates a document, the client window creates a child window for the document. Each child window has a border that can be resized, a title bar, a system menu, a minimum maximize button, and so on. Only one child window at any given time is active. Child windows cannot exceed the scope of the client window.

Developing an MDI application with a generic development tool is rather cumbersome: you have to register frame and child window classes, create frame windows and client windows, write message loops and callback functions, create child windows, and so on, and each of these steps is not easy. But in Borland C + + Builder (hereinafter referred to as CB) implementation of MDI application is relatively simple, you just set the properties of the form Formstyle can be: the frame window Formstyle set to Fsmdiform, The Formstyle of the child window is set to Fsmdichild. In addition, CB itself also provides the MDI program template, select file| new| projects| MDI application, as shown in the following illustration:

CB will produce an MDI application framework. Direct compilation runs the program and you can see that the program already has the basic characteristics of an MDI program.

We use this template to design an MDI application. This program is a multiple document editor that supports multiple text and plain text formats, and also supports toolbar shortcuts and printouts. Let's talk about its specific development process:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.