complete-reference-vb_net_92
complete-reference-vb_net_92
Build your application (from the Project menu's Debug, Start New Instance menu item). If your method is
implemented as shown in the above code, you'll be able to create new MDI child forms. By setting the
MDIlist property to True, we can see the enumeration of child windows in the Window menu, as illustrated
in Figure 16−5.
When you implement child forms in MDI applications, you need a way to reference the active form from
other forms and from the parent form. Seldom do you ever work with a child form in total isolation from the
rest of the application and its sibling forms. For example, how would you be able to copy text from one child
form's text editor to another child form's text editor without having access to the handles of source and target
objects?
You can obtain a reference on the active form by using the facility of the parent's ActiveMDIChild property.
The property returns to you the child form that currently has the focus, or the form that was the most recently
active.
In addition, you also need to have information about which control on a child form is active. This information
comes to you by way of the ActiveControl property. So, if we have more than one control active on a form,
this property lets us know which control is currently in focus, or being referenced.
The following code demonstrates the referencing of these properties, and thus of the various properties
exposed to the form objects:
576