Presentation is loading. Please wait.

Presentation is loading. Please wait.

Multiple-Document-Interface (MDI) Windows MDI programs enable users to edit multiple documents at once. MDI programs enable users to edit multiple documents.

Similar presentations


Presentation on theme: "Multiple-Document-Interface (MDI) Windows MDI programs enable users to edit multiple documents at once. MDI programs enable users to edit multiple documents."— Presentation transcript:

1 Multiple-Document-Interface (MDI) Windows MDI programs enable users to edit multiple documents at once. MDI programs enable users to edit multiple documents at once. Parent window: the application window of an MDI program Parent window: the application window of an MDI program Child window: each window inside the application Child window: each window inside the application To create an MDI form, set its IsMdiContainer property to true To create an MDI form, set its IsMdiContainer property to true

2 MDI windows Single-document-interface (SDI) Single-document-interface (SDI) Multiple-document-interface windows (MDI) Multiple-document-interface windows (MDI) Enable users to edit multiple documents at once Enable users to edit multiple documents at once The application window of an MDI program is called the parent window The application window of an MDI program is called the parent window Each window inside the application is referred to as child window Each window inside the application is referred to as child window MDI can have many child windows MDI can have many child windows Each child window can only has one parent Each child window can only has one parent Child window cannot be parent themselves Child window cannot be parent themselves A maximum of one child can be active at once A maximum of one child can be active at once Child window cannot be moved outside their parent Child window cannot be moved outside their parent

3 To create an MDI form Create a new form Create a new form Set its IsMdiContainer property to true Set its IsMdiContainer property to true ( when you do that, the form changes appearance) ( when you do that, the form changes appearance) Next create a child form class to be added to the form Next create a child form class to be added to the form

4 Code needed in the parent Write the following code in the parent form class ( at proper place, will explain) Write the following code in the parent form class ( at proper place, will explain) ChildFormClass *frmChild = new ChildFormClass(); ChildFormClass *frmChild = new ChildFormClass(); frmChild->MdiParent = this; frmChild->MdiParent = this; frmChild->Show(); frmChild->Show(); Where ChildFormClass is the name of the child Where ChildFormClass is the name of the child frmChild is a object name frmChild is a object name This is pointer that always point the current object, in this case, the parent form This is pointer that always point the current object, in this case, the parent form

5 Layout format Common method: Common method: LayoutMdi ; determines the display of child forms on an MDI parent. Takes as a parameter an MdiLayout LayoutMdi ; determines the display of child forms on an MDI parent. Takes as a parameter an MdiLayout MdiLayout::Cascade MdiLayout::Cascade MdiLayout::TileHorizontal MdiLayout::TileHorizontal MdiLayout::TileVertical MdiLayout::TileVertical

6 code to set layout In anywhere when you need to set the format In anywhere when you need to set the format this->LayoutMdi( MdiLayout::Cascade); this->LayoutMdi( MdiLayout::Cascade);


Download ppt "Multiple-Document-Interface (MDI) Windows MDI programs enable users to edit multiple documents at once. MDI programs enable users to edit multiple documents."

Similar presentations


Ads by Google