0
No, quite that either.
If the new form is simply adding stuff, for example, using a picture box as opposed to a text box for displaying the main content while keeping a toolbar on the left the same, you can use the base class's code. The form designer creates an InitializeComponent method, which you can call from the inherited form to initialize the parts inherited from the base form.
The general concept is this: The inherited form has those controls declared but does not automatically initialize them. You must initialize those base form controls in the inherited form somehow. You can initialize them in the inherited form, or you can call an initializer from the base form (the InitializeComponents method created by the designer) to do the job.
0
so basically i have to modify any controls from the base form in the code of the new form instead of using the designer. i guess i can bare with that. thanks for the help
0
I am assuming the controls were created by the form designer.
Inherited forms do inherit controls. The problem is that the controls, though they are members of the base class, are not initialized because their initialization code is called by the constructor of the base class. To inherit the controls, add an extra " : base()" to your method declaration to automatically call the base class constructor.
so you'd have something like:
class inheritedForm : Form1
{
public inheritedForm : Form1()
{
//other initialization code here
}
}
This calls the parent constructor which creates instances of controls and adds them to the form.