Subclassing your own UserControl

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?
 
G

Guest

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
 
A

arncota

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.
 
B

BigCanoe

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top