396 Part III Designing the User Interface
As usual, Visual Studio lists all the possible templates you could include in your projects,
not just those related to inheritance. The Inherited Form template gives you access to
the Inheritance Picker dialog box.
You can also use the Name text box at the bottom of the dialog box to assign a name
to your inherited form, although it is not necessary for this example. This name will
appear in Solution Explorer and in the file name of the form on disk.
- Click Add to accept the default settings for the new, inherited form.
Visual Studio displays the Inheritance Picker dialog box, as shown here:
This dialog box lists all the inheritable forms in the current project. If you want to
browse for another compiled form, click the Browse button and locate the .dll file on
your system.
Note If you want to inherit a form that isn’t a component of the current project, the form
must be compiled as a .dll file.
- Click Form1 in the Inheritance Picker dialog box, and then click OK.
Visual Studio creates the Form2 .vb entry in Solution Explorer and displays the inherited
form in the Designer. Notice in the screen shot at the top of the following page that
the form looks identical to the Form1 window you created earlier except that the two
buttons contain tiny icons, which indicate that the objects come from an inherited
source.
It can be difficult to tell an inherited form from a base form (the tiny inheritance
icons aren’t that obvious), but you can also use Solution Explorer and the IDE tabs to
distinguish between the forms.