Inherit from UserControl vs Control

  • Thread starter Thread starter Michael C
  • Start date Start date
M

Michael C

I've created my own abstract control inheriting it from Control instead of
Usercontrol. All works fine but anyone who inherits from my control cannot
design their own control. Do I need to add an attribute to tell the IDE that
my control is designable?

Thanks,
Michael
 
Hi Michael,

What you're talking about is Design-time support, and extending Design-time
support, which is done by a combination of Design-time attributes and custom
Designer and related classes.

This is a pretty extensive topic. I'm going to give you some starting
reference points:

http://msdn2.microsoft.com/en-us/library/w29y3h59(VS.80).aspx
http://msdn2.microsoft.com/en-us/library/37899azc(VS.80).aspx

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.
 
Michael said:
I've created my own abstract control inheriting it from Control instead of
Usercontrol. All works fine but anyone who inherits from my control cannot
design their own control. Do I need to add an attribute to tell the IDE that
my control is designable?

The IDE designer needs to create an instance of the base class of the
control you are trying to design. Since it is abstract, the designer
obviously fails. I could not beat it, had to convert abstract methods
to just virtuals.
 
Back
Top