Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Just to make sure I am doing it right
Message
General information
Forum:
ASP.NET
Category:
Other
Title:
Just to make sure I am doing it right
Miscellaneous
Thread ID:
00984198
Message ID:
00984198
Views:
53
I still have a few controls from System.Windows.Forms that I need to subclass and as I started doing this I started getting ussure if I was doing it by the book.
Here is what I do:
1. I right-click on the solution and add a new item
2. I choose "User Control" from the list and give my control a name (i.e. ALS.Subclass.TextBox)
3. Once the designer is up I switch to code view and change the class name to TextBox (I assume VS.NET doesn't like my filename with nultiple dots). I also change the namespace and constructor name.
4. When I now switch back to the designer I see the following text: To add components to your class, drag them from the Server Explorer or Toolbox and use the properties windows to set their properties. To create methods and events for your class, click here to swtch to code view.
5. Then I change the font and add some methods or events.
6. Now my subclassed TextBox should be ready to be used, but I am having prblems displaying the usercontol in the toolbox so I usually add a standard TextBox and change the declare statement and initilazation through code to use my subclass.

Can anyone see if I am doing something wrong? Can I do this a different way? Should I do it a different way? Keep in mind this is mostly for simple usercontrols where I most of the time just change the font and such.

Any comments or advice is welcome.

Thanks,
Einar
Semper ubi sub ubi.
Next
Reply
Map
View

Click here to load this message in the networking platform