Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# Get total inside area of scrollable panel

Tags:

c#

width

panel

area

Should be a nice easy one for someone...

I have a panel which I am dynamically adding child controls to, to the point where scroll bars will appear when any of them are placed outside of the visible area.

I need to know the total size of this area. i.e. how wide the scrollable area is?

I could get the furthest placed control and use its left + width properties, but there must be a cleaner way?

Edit: Hopefully this illustrates what I need (Scrollable area width). enter image description here

like image 983
user1830285 Avatar asked Nov 11 '22 23:11

user1830285


1 Answers

Try with this

SystemInformation.VerticalScrollBarArrowWidth

see http://msdn.microsoft.com/en-us/library/system.windows.forms.systeminformation.verticalscrollbarwidth.aspx

like image 71
Alessandro D'Andria Avatar answered Nov 14 '22 23:11

Alessandro D'Andria