Flowlayout panel does not display scrollbar after some resizing

I have a flowlayout panel and a resize event, I resize all the controls inside the flowlayout panel to fit the width (flowlayoutpanel - padding - scrollbar width). At some sizes, the scroll bar is not displayed, hiding most of the controls outside the flowlayout pane, and with other changes, the scroll bar is displayed. I set the AutoScroll property in the flowlayout panel to true. All this is done using C #, but I also ran into this problem in VB.net.

Is there a way to get flowlayoutpanal to recount how controls are laid out after resizing controls in a resize event or some other way to fix this problem?

+3
source share
2 answers

Try the method .PerformLayout(), see if this helps.

+5
source

Using the Refresh method (inherited from Control), you can force the control to invalidate and redraw itself and its children.

Edit: Curious, are you doing this resizing to get a stacking effect from top to bottom?

+1
source

Source: https://habr.com/ru/post/1697843/


All Articles