Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subclassing a textbox
Message
From
06/11/2003 22:23:36
Km Kwun
Eastop Consultants Limited
Nt, Hong Kong
 
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00846490
Message ID:
00847482
Views:
23
Thanks for your help.

KM

>KM,
>
>If you want to add your textbox to the toolbar, then you need to create a separate project to hold your sub-classed controls. That way you can point the toolbar to the DLL that contains these sub-classes. Then you can drag and drop the control onto your form.
>
>The other option is to change the code-behind for your form to point to the sub-classed textbox instead of the base one. You would need to do a search and replace for any reference to the base textbox and replace it with you sub-classed reference. Make sure you save the code-behind file before switching to the design tab of your form. If not then your control may not show up properly.
>
>>Hi Cathi,
>>
>>Thanks for your information. After creating this new class in code, how can I put it into the form.
>>
>>KM
>>
>>
>>>Hi Km,
>>>
>>>You can't use the visual designer to subclass the textbox. You need to create a new class and have it inherit from the textbox class:
>>>
>>>
>>>public class myTextBox : TextBox
>>>{
>>>
>>>}
>>>
>>>
>>>>How can I subclass a textbox? I created a Windows Control Library project and choose "Add Inherited Control" from the Add New Item menu. However "textbox" is not available. Could any body show me the way?
>>>>
>>>>TIA
Previous
Reply
Map
View

Click here to load this message in the networking platform