ClientSize

  • Thread starter Thread starter Marco
  • Start date Start date
M

Marco

For a panel with a vertical scrollbar the cliente area is
the width of the panel minus the width of the scroll bar,
right ? Well, it is not working for me here. When I do

panel.ClientSize = new Size(newWidth, new Height);

the scrollbar takes part of the newWidth.
I know I could add 17 (the width of the scrollbar) but this
is not true 100% fo the time.
So the question is: How to set the width of the panel free
for my controls, not couting the scrollbar ?

Thanks for any help.

______
Marco
 
Marco said:
panel.ClientSize = new Size(newWidth, new Height);
[...]
the [vertical] scrollbar takes part of the newWidth.
I know I could add 17 (the width of the scrollbar) but this
is not true 100% fo the time.

Instead, you could use SystemInformation.VerticalScrollBarWidth.

P.
 
Instead, you could use
SystemInformation.VerticalScrollBarWidth.

Yes, but I should add this width only if the vertical
scroll bar is shown.
Thanks.

______
Marco
 
Back
Top