Professional Documents
Culture Documents
Structure of Unit:
8.0 Objectives
8.1 Introduction
8.2 Concept of MDI Forms
8.2.1 Creating and using MDI Form.
8.2.2 Arranging the Child forms.
8.3 Concept of Flexgrid Control
8.3.1 Adjusting the size of Controls.
8.3.2 Adding MS-Flexgrid Control.
8.3.3 Changing the Cell Width and Height.
8.3.4 Entering the values in the cells of grid.
8.3.5 Scrollbars in MS-Flexgrid.
8.4 Summary
8.5 Self Assessment Questions
8.0 Objectives
After completing this unit, you will be able to:
Understand the concept of MDI Forms
Understand the concept of Flexgrid Control
Know about the arranging of child form
Learn the Use of MS Flexgrid
8.1 Introduction
The Multiple Document Interface (MDI) was designed to simplify the exchange of information among
documents, all under the same roof. With the main application, you can maintain multiple open windows, but
not multiple copies of the application. Data exchange is easier when you can view and compare many
documents simultaneously.
Flex Grid is a control which facilitates display of tabular data on a Form, along with the facility of Adding a
Row, Deleting a Row and Sorting of records etc.
Using Microsoft’s FlexGrid control (MSFLXGRD.OCX) you can create utilities to display, filter, edit,
validate and update your data. For example, such utilities could include:
127
<> MDIMenu Menu caption
MDIOpen opens a new child Form
MDIExit terminates the application
* Then design the following menu for the child Form
<> ChildMenu Menu caption
Child Open opens a new child Form
Child Save saves the document in the active child Form
Child Close Closes the active child Form
At design time double click on MDI Open and add the following code in the click event of the open menu.
Form1.Show
And so double click on MDI Exit and add the following code in the click event
End
Double click on Child Close and enter the following code in the click event
Unload Me
Before run the application in the project properties set MDI Form as the start-up Form. Save and run the
application. Following output will be displayed.
And as soon as you click MDI Open you can notice that the main menu of the MDI Form is replaced with
the Menu of the Child Form. The reason for this behavior should be obvious. The operation available
through the MDI Form are quite different from the operations of the child window. Moreover, each child
Form shouldn’t have it’s own menu.
8.2.1 Creating and using MDI Form
The acronym MDI stands for Multi Document Interface. If you have ever used Microsoft Word or Excel
the chances are you have used a multi-document interface. Multi-document interfaces consist of a parent
form (also called a container) which contains other forms. For example, when more than one document is
open in some versions of Microsoft Word, each document appears in its own form, contained within the
parent form. The forms within the parent can be moved to any position within the parent form, but typically
cannot be moved outside the confines of the parent.
The term MDI is actually misleading. A more accurate name would be multi-form interface or multi-
window interface. The reason for this is that there is nothing that restricts the forms to containing just
documents. In fact, a form in an MDI interface can contain anything that a form in a non-MDI interface can
128