Inherited forms

J

Johnny E. Jensen

Hello NG

When i start a new development i try to make base controls like textbox,
checkbox, combobox ect. so that i later on don't have to replace a control
because the one i placed on a form don't meet my wanted funtionallity.

Now I want to look into working with inherited forms.
I make a base form and design the form with tablelayout controls, panles -
just some design stuff that i want for all my forms.

Then i create a new form based upon that base form and i see the design
layout just fine. BUT I am not able to put other forms controls on that new
form, WHY??

Kind regards

J Jensen
 
F

Family Tree Mike

Hello NG

When i start a new development i try to make base controls like textbox,
checkbox, combobox ect. so that i later on don't have to replace a
control because the one i placed on a form don't meet my wanted
funtionallity.

Now I want to look into working with inherited forms.
I make a base form and design the form with tablelayout controls, panles
- just some design stuff that i want for all my forms.

Then i create a new form based upon that base form and i see the design
layout just fine. BUT I am not able to put other forms controls on that
new form, WHY??

Kind regards

J Jensen

Are you
1. creating a standard class file having the class inherit from your
base form?

-or-

2. Creating a normal form and changing the inheritance in the
form.designer.cs and form.cs files?

Both methods work for me, though in method 1, you need to add a
constructor to call InitializeComponent().
 
J

Johnny E. Jensen

Hello Mike

I do as follow:
Create a new form by the designer (Add/Windows Form) this form i call
BaseForm.
On the BaseForm i put all my controls that i want all my form to have.
Then i build the project.

Now i add a new form like this: Add/New Item... in the add new dialog i
choose the Inherited form wizard. And in that dialog i choose the BaseForm.

kind regards
J Jensen
 
F

Family Tree Mike

Hello Mike

I do as follow:
Create a new form by the designer (Add/Windows Form) this form i call
BaseForm.
On the BaseForm i put all my controls that i want all my form to have.
Then i build the project.

Now i add a new form like this: Add/New Item... in the add new dialog i
choose the Inherited form wizard. And in that dialog i choose the BaseForm.

kind regards
J Jensen

Sorry, my versions of Visual Studio do not offer this wizard. What
version are you using?
 
J

Johnny E. Jensen

Hi Mike

I am using Visual Studio Team System 2008 Development Edition.

/J Jensen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top