Inherits TextBox and then?

  • Thread starter Thread starter Werner Maier
  • Start date Start date
W

Werner Maier

Hi,

I have inherit a class from TextBox. In my class I do some stuff. But how
can I get my class to a form? Placing a normal TextBox and changing TextBox
to MyTextBox will not work. The box disappears from the form.
What must I do?

Thanks
Werner
 
* "Werner Maier said:
I have inherit a class from TextBox. In my class I do some stuff. But how
can I get my class to a form? Placing a normal TextBox and changing TextBox
to MyTextBox will not work. The box disappears from the form.
What must I do?

Create a new usercontrol and then replace its implementation with the
implementation of your textbox. Then try to drag your control from the
toolbox onto a form.
 
Just build the project containing your inherited control. If you don't have
the project along with your main app project, you can reference it from the
References section.Otherwise, you should see your control in the toolbox
under 'My Controls' or something like that. You can then use it just like
any other WinForm Controls.

Imran.
 
Back
Top