The problem I am having is with a panel, which starts at the size 200x200 pixels. For the program I am writing, at any given time I need to know how big this panel is, but this gets difficult as AutoScroll is on and when large content is inserted the panel expands (and gets scroll bars).
I have looked a bit at AutoScrollPosition and AutoScrollOffset, and even tried implementing this in my solution - but it appears this only tells you information about the panel when the scroll bar is in a certain position - whereas at any given time I need to know the total size of the panel.
So basically, suppose some content got entered into the panel and taking the scrolling distance into account it really became a 600x750 pixel panel. Does anyone know of any way I can actually get this information?
Thanks
The "including scroll bars" clause makes the question unanswerable. Because the scrollbars are only applied to the DisplayRectangle.
You can get the required size of the panel so that no scrollbars are necessary from the PreferredSize property. You can get the height and width of the scrollbars from the SystemInformation.HorizontalScrollBarHeight and VerticalScrollBarWidth properties.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With