Subclassing your own UserControl

  • Thread starter Thread starter arncota
  • Start date Start date
A

arncota

Hi,

I created a UserControl, and created its UI with the designer. Next,
I wanted to create a subclass of that UserControl, with a new UI. But
when I open it in the designer, I see the UI components from the
parent class. When I step through the code, it looks like the
InitializeComponents of my base UserControl is getting called, and
then the version in my subclass.

Is there any way to prevent this? Is there a better way to create
subclasses of visual composition components?
 
What are you actually trying to accomplish? The whole purpose of
subclassing is to extend the functionality of the parent class. Sounds like
you're trying to eliminate the functionality of the parent.

J
 
What are you actually trying to accomplish? The whole purpose ofsubclassingis to extend the functionality of the parent class. Sounds like
you're trying to eliminate the functionality of the parent.

J

Actually, I am trying to extend the functionality, but change the UI.
The base class has methods that apply to all the types of objects, but
each type of object has its own UI.
 
Actually, I am trying to extend the functionality, but change the UI.
The base class has methods that apply to all the types of objects, but
each type of object has its own UI.

I decided to do it with an interface instead of a subclass.
 
Back
Top