Visual Basic 2005


Add to MY Favorites...

Back to Vicky's Home Page Teaching Home Page Visual Basic 2005 Html For Kids

Inheritance

Inheritance commands can be used to make a duplicate of a form with its objects and properties. The duplicate can then be customized.

Inheritance Picker

Use to integrate existing forms into a project.

  • Create the first form, including only labels and controls which will be common to all the forms you will create from it.  I call this form the template and name it template.vb.

  • Save the project.

  • Build the project by pulling down the Build menu, then chose Build project name. This step causes VB to compile, or recompile the project, creating the .exe and .dll files. When the base form is recompiled, the changes will be passed to the inherited form.

  • Pull down the Project menu, choose Add New Item.

When the build is complete, the words Build succeded will appear at the bottom left corner of the window.

  • Click the Inherited Forms icon, type a name for the form, and then click Add.

 

Another window will open, where you can choose which form you want to have inheritance drawn from.  Click the browse button to access other forms in other projects, if the form you want inheritance from is not within the current project. The form files have a .dll extension.

  • Click the form from the list to choose it.

  • Click OK.

 

The window closes and your new form will appear in the IDE.  Make whatever customizing adjustments you need to it, to make this version of the form unique. The screen size is identical.

My example will use the template form to develop the MsinMenu, Add Item, Edit Item and Print Report forms.  The title items and the exit button will be in exactly the same place.  When I switch from the Main Menu form to another form, it will not look like forms have changed at all.  It will appear as though the Main Menu form has only changed its content. I save development time.

 


 
Another page developed by
vicky@vickywoodard.com
Copyright © 2006 Vicky K. Woodard
All rights reserved
Last updated: 8/17/2006