inherited form

E

e-mid

i have a generic form with alot of controls on it, when i inherit a new
form, i can not see the design of my new form on the visual studio and get
an error on designtime.

Error is:

The designer could not be shown for this file because none of the classes
within it can be designed. The designer inspected the following classes in
the file:

form2 --- The base class 'form1' could not be loaded. Ensure the assembly
has been referenced or built if it is part of the project.
 
E

e-mid

ok, i do it.
i dont know if that is right method to solve this problem: i copy the
properties that belongs to form1 (such as size) and paste to form2, now i
can see form2 on the designer.
 
M

Morten Wennevik

Hi e-mid,

You need a reference to form1 in your project. (In your Solution Explorer, right-click References->Add Reference ... and browse to a dll or exe where form1 is defined.
 
E

e-mid

Morten, i do not use any dll, i just create form1 with visual studio
designer and inherit form2, my problem was i can not see form2 on the
designer, i solved it as i explained in my other post.

thnkz..

Morten Wennevik said:
Hi e-mid,

You need a reference to form1 in your project. (In your Solution Explorer,
right-click References->Add Reference ... and browse to a dll or exe where
form1 is defined.
 
M

Morten Wennevik

Did you use "Add Inherited Form" when creating Form2? The inherited Form will look slightly different with a small blue arrow box in the upper left corner of all inherited controls, putting a control on Form1 should cause it to appear on Form2 too (might take a few seconds before it shows).
 
E

e-mid

no, i dont even know about it :) , but i will give a try now

thnkz

Morten Wennevik said:
Did you use "Add Inherited Form" when creating Form2? The inherited Form
will look slightly different with a small blue arrow box in the upper left
corner of all inherited controls, putting a control on Form1 should cause it
to appear on Form2 too (might take a few seconds before it shows).
 
M

Morten Wennevik

Come to think of it, this way is exactly the same way as creating a new form and changing the inheritance from System.Windows.Forms.Form to Form1. Are you sure you inherit from the correct form1 (maybe it should be Form1 or something else)
 
E

e-mid

yes, "add inherited form" does the same thing i do,
i am not sure about what was wrong,
i deleted some controls on form1 on the code editor, before inheriting
form2 , maybe the problem was about it.

anyway, there is no problem now.


Morten Wennevik said:
Come to think of it, this way is exactly the same way as creating a new
form and changing the inheritance from System.Windows.Forms.Form to Form1.
Are you sure you inherit from the correct form1 (maybe it should be Form1
or something else)
 

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