I'm used to working in visual C++. In learning C#.NET I tend to try to find equivalent methods to how things are done in VC++.
When I have a button in C++, to get full control over it I create a class derived from CButton (the equivalent of System.Windows.Forms.Button in .NET) and then set this class as the type for my button in order to get all events and overrides routed into my code.
In C# I haven't really found an equivalent way to do this. There seems to be no way to set which class a control should be created from, and I haven't even bothered trying to replace the auto-generated code where the object is created since it is likely to be discarded the next minute.
What's the correct way of using my own class to front a user control?
EDIT: I should clarify that I'm interested in adding my custom class to the existing project. Most of the responses so far either provide non working ways of adding it to the existing project, or working ways of creating an external library with the component (DLL), but that's a bit overkill for my particular case.