Custom Control issue in design view

  • Thread starter Thread starter Tom P.
  • Start date Start date
T

Tom P.

I am trying to make a custom control. The problem I'm having is that
if I inherit from Control I can't get the bloody thing to display
anything. But if I inherit from UserControl I can't hide any of the
properties (namely the size). How do I get the control to display in
design view and still retain control over the properties?

Thanks in advance,
Tom P.
 
I am trying to make a custom control. The problem I'm having is that
if I inherit from Control I can't get the bloody thing to display
anything. But if I inherit from UserControl I can't hide any of the
properties (namely the size). How do I get the control to display in
design view and still retain control over the properties?
(...)

You will find solution for both cases (showing, hiding) here:
http://www.c-sharpcorner.com/Upload...PicBox04062008025116AM/CSSrollablePicBox.aspx

Dawid Rutyna
 
I am trying to make a custom control. The problem I'm having is that
if I inherit from Control I can't get the bloody thing to display
anything. But if I inherit from UserControl I can't hide any of the
properties (namely the size). How do I get the control to display in
design view and still retain control over the properties?

Thanks in advance,
Tom P.

OK, I figured out the issue. The Control object doesn't display itself
in the IDE unless you place it in a control or form. I guess this is
so it doesn't have to execute any paint code or other stuff that might
blow-up at design time.

If you want to see a control inherited from Control, place it in a
Form.

Tom P.
 
Back
Top