I'm working on a program feature in which a FlowLayoutPanel (whose flow direction is set to TopDown) should adjust its width based on whether or not the vertical scrollbar is visible on the screen. I have figured out how to detect if the scrollbar is visible.
My problem is that I can't seem to figure out how to find the width of the (pre-programmed) vertical scrollbar. The reason that I want to expand the panel's width when it overflows is because the scrollbar overlaps the controls in the panel.
If possible, I'd like to avoid changing the margin/padding of the controls, and I would like to avoid using constants that I declare myself in my code.
I'd also like to avoid adding a VerticalScrollBar component, unless there is an easy way to programmatically scroll through the overflown panel based on the scrollbar's thumb position.
Does anyone have any ideas? Thanks!