visual inheritance

CRP

Member
Joined
Oct 30, 2007
Messages
11
Programming Experience
3-5
I am creating a tool bar in vb.net windows form (in visual studio 2005). I need to inherit the tool bar in all my forms? How to achieve it? I need the full code.

Pls help
 
What do you mean by "inherit" ? It has specific meaning in Object Oriented languages and that meaning doesnt make much sense when applied to oyur post
 
What you need to do is create a base form that has your toolbar and/or menu defined. Then create a form(s) that inherits from the base form. All other forms will have the same toolbar and menu.

If your inherited form has different actions for similar buttons, eg, a delete button deletes different items depending on what form is open, then you will need to override the delete_button_ClickEvent on the inherited form to handle specific situations.

Another way is to use a MDI form and child forms. The child forms will automattically get the MDI form's toolbar and menus. However, this has its own complications. For instance, maximising and minimising forms. You may not want this functionality.
 
Back
Top