inherited form

  • Thread starter Thread starter e-mid
  • Start date Start date
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.
 
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.
 
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.
 
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.
 
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).
 
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).
 
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)
 
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)
 
Back
Top