Thursday 4 April 2013

Multi Document Interface

  • While desdignng an application it can contain any no. of forms in it, right now to run the desired form we are explicitly specifying the form class name under program class. But when we provide the app to client we only give him the assembies of the project(ie IL code). So client doesnot have a chance to edit the client program and specify the form class name he wants to run.
  • To overcome the above problem we are provided with an approach known as multi document interfaces where in this approach an application will be having on form as a startup form which is refereed to as mdiparent or mdicontainer, so that clients dont require to change the form name under program class at any time. Rest of the forms in app will be under the control of mdiparent form and refered to as mdichilds. To make a form as mdiparent set the property ismdicontainer as true. . Note:An application can have only one mdiparent and all other fprms must be childs of parent which should come and sit under parent. Eg: VS is an mdiparent and launches all other forms like "New Project", "Add New Item" as its childs.
  • To launch a form as child of parent create object of child from class, set its mdiparent property with parent forms reference and then class show() method.
Layout:
  • When we have more than one child forms opened at a time under parent, child forms will be arranged inside the parent by using a layout for arrangement which can be any of the four options like
               - Cascade: Child forms are arranged one on top of the other.
               - TileVertical:  Child forms are arranged one beside the other.
               - TileHorizontal: Child forms are arranged one on top of the other.
               - ArrangeIcons: All child forms are arranged with in the bottom of the parent.

No comments:

Post a Comment