Custom Control issue in design view

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

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?
(...)

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

Dawid Rutyna
 
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.

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.
 

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