In this tutorial, I’ll show you how you could inherit visual objects in vb.net.
Inheriting visual objects, means that you need a ‘base form’ which you will inherit from and a form which would inherit from that base form (I forgot what its called, if you know it feel free to comment)
Add up visual elements in your base form (buttons, textboxes, groupbox, tab control, etc).
Then make a new windows form which would inherit from the base form which you have just made.
After that, click on the ‘show all files’ option on your solution explorer on the upper right pane of your visual studio window.
Expand the Form which will inherit from the base form, then double click on the file with ‘.Designer.vb’ extension. In my case, its named Main.Designer.vb since the name of my form is Main.
After double-clicking, you would see something like this:
The point of interest is the one that I have highlighted, obviously.
Now, change this line of code to fit yours.
Just change the WindowsApplication3 to the actual name of the project which you have created. The one that is on the uppermost part of the solution explorer:
Then change the Form1 to the actual name of the base form that you have created.
That’s it, now you won’t have to copy and paste the same visual elements to each of your forms just to have a consistency in your application. Just do the same to all of the forms that needs to inherit from a base form.