Problems with FlowLayoutPanel inside panel using AutoSize
I have the following control hierarchy:
Form
Panel (AutoSize = true, AutoSizeMode = GrowAndShrink, Dock = Top)
FlowLayoutPanel (AutoSize = true, AutoSizeMode = GrowAndShrink, Dock = Top)
Control1, Control2, Control3, Control4, ...
FlowLayoutPanel (AutoSize = true, AutoSizeMode = GrowAndShrink, Dock = Top)
Control1, Control2, Control3, Control4, ...
This is how it looks in different sizes:
All 8 buttons are fully displayed, but the panel forgot to compress
The first FlowLayoutPanel is fully visible, but the second is only halfway visible, button 8 is missing
The first FlowLayoutPanel is fully visible, but the second is only halfway visible, button 7 and button8 are missing
The first FlowLayoutPanel is fully visible, but the second is only displayed at a quarter, button 6, button 7 and button 8 are missing
As you can see, I am not satisfied with this behavior. Is there something I can do to get all this work?
+2
source to share
1 answer
I think this is a bug ... you can report it to Microsoft.
One possible way: try using tableLayoutPanel instead of your front panel. Like this:
Form
TableLayoutPanel (1 column, 2 rows with 50% size type)
FlowLayoutPanel1 (AutoSize = true, in first row of the TableLayoutPanel, Dock = Fill)
Button1, Button2, Button3, Button4, ...
FlowLayoutPanel2 (SutoSize = true, in second row of the TableLayoutPanel, Dock = Fill)
Button1, Button2, Button3, Button4, ...
+1
source to share