Database Reference
In-Depth Information
Figure 9-20. Running an MDI form application
How It Works
Each windows form is a class and exposes a Show() function by an instance created for it. You use the
following code, which is creating an object and then invoking the Show() method. This opens the other
form from the MDI parent form.
This creates an instance of the WinApp form and opens it for you:
WinApp objWA = new WinApp();
objWA.Show();
The following code creates an instance of the UserInfo form and opens it for you:
UserInfo objUI = new UserInfo();
objUI.Show();
You close the application with the following code:
Application.Exit();
Try It: Opening an MDI Child Form Within an MDI Application
As mentioned and shown in Figure 9-20, the problem is that even though the MDI form shows a parent
menu, the forms are still able to open outside, and context is moved from a form to another. You can try
clicking the title bar of each the open form, and you will see how you can move back and forth with these
opened forms.
 
Search WWH ::




Custom Search