Ivan
Ivan

Reputation: 5250

c# winforms flowlayoutpanel wrap contents

I have problem with wrap contents in flowlayoutpanel control. Before i enable wrap content grid of buttons is listed good. When i enable Autoscroll and change FlowDirection my butons was showed vertical not as grid like above buttons. White buttons need to be showed as above blue buttons. Red boxes explain how to loop it. But when i disable Wrap contents everything work good. What can be problem ? Check screenshot

enter image description here

Upvotes: 1

Views: 3342

Answers (1)

JMadelaine
JMadelaine

Reputation: 2964

Without seeing your code, I can only guess, but it looks to me as though you've set the flow direction to TopDown. Since you've enabled AutoScroll, the panel will implement a vertical scroll bar instead of wrapping back to the top.

Try the following:

myFlowPanel.FlowDirection = FlowDirection.LeftToRight;

Upvotes: 1

Related Questions