Database Reference
In-Depth Information
objWA.Show();
The wa.MdiParent=this; line tells the child form which form is its parent. Because you want all the
child forms to appear inside ParentForm and you write the code inside the MDI parent form, you can
use the this keyword to represent the current object.
Set the previous suggested changes for UserInfo as well.
UserInfo objUI = new UserInfo();
objUI.MdiParent=this;
objUI.Show();
Try It: Arranging MDI Child Forms Within an MDI Application
Multiple forms will open within one MDI window, so once you have a few open, your MDI application
will be cluttered. It's hard to move forms around to shift you focus from one to another. Hence, it is
prime concern to have a mechanism that allows you to arrange the forms in an organized manner.
For example, in most applications you can arrange the forms and then cascade them so you can see
the stack of open forms. Or you can tile them vertically or horizontally so you can see multiple forms side
by side. You can even minimize all the open forms and arrange them as an icon.
To accomplish this, in this exercise you will add the Windows menu as shown in Figure 9-22.
Figure 9-22. Windows menu of MDI form application to arrange child forms
.NET's Windows Forms offers the LayoutMdi method, which takes the MdiLayout enumeration to
rearrange the child forms in an MDI parent form. There are four modes you can arrange your forms into:
Cascade, Tile Horizontal, Tile Vertical, and ArrangeIcons.
 
Search WWH ::




Custom Search