User Control and Textbox Inheritance

H

houghtelling

Is it posible to inherit from a textbox and then place that inherited
textbox onto a user control in that same project?

When I try to do this I get the error: "Could not find type
'MyTextBox'. Please make sure that the assembly that contains this type
is referenced. If this type is a part of your development project, make
sure that the project has been successfully built."

Thanks,
Jerod
 
B

Bruce Wood

Is it posible to inherit from a textbox and then place that inherited
textbox onto a user control in that same project?

Yes, but between the time that you create the inherited text box class
and the time that you try to place it on the user control you have to
have done a successful build of the project. As well, if you ever have
the Designer open on the user control when the project fails to
compile, the Designer may decide to remove the inherited text box from
the user control, because there will be no compiled assembly for it.
When I try to do this I get the error: "Could not find type
'MyTextBox'. Please make sure that the assembly that contains this type
is referenced. If this type is a part of your development project, make
sure that the project has been successfully built."

Probably because your project has failed to compile, so the compiled
assembly is gone, and so the Designer no longer knows what MyTextBox is.
 

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