How to set the size of the "Client Area" of a Custom control ?

  • Thread starter Thread starter TheSteph
  • Start date Start date
T

TheSteph

Hi,

I've made a CustomPanel derived from the Panel class.

How can I set my own size of the "client area" of that CustomPanel ?

("client area" = Size of the rectangle in which one can drop controls from
the toolbox, or place a control by code)

Because of the large border, some control too close of the border are on
top the border. I would like to prevent user to drop control where the
border is drawn.

Thanks for help !

Steph.
 
Thanks for your reply and the Link !



I have another question :

Except very simple controls like aggregate of existing controls and
"client area painting", what is the best way to make CustomControl to be
used in .NET ? Is it to make it in C++ and then write a wrapper class in
..NET ?



Steph.
 
You can write custom controls in any .NET language you like--which is what
I'd recommend if you want to consume then in a .NET application.

If you want to aggregate one or more existing controls then I suggest
deriving from UserControl.

If you want to create a control that performs painting entirely itself, I
suggest deriving from Control. Or Button, if you want to handle mouse
clicks--it makes life a little easier.
 

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

Back
Top