views:

208

answers:

1

I have the following controls 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, ...

Here is how it layouts in various sizes:

Fully visible all 8 buttons, but the Panel forgot to shrink

Fully visible all 8 buttons, but the Panel forgot to shrink

The first FlowLayoutPanel are fully visible, but the second is only half visible, button8 is missing

The first FlowLayoutPanel are fully visible, but the second is only half visible, button8 is missing

The first FlowLayoutPanel are fully visible, but the second is only half visible, button7 and button8 are missing

The first FlowLayoutPanel are fully visible, but the second is only half visible, button7 and button8 are missing

The first FlowLayoutPanel are fully visible, but the second is only quarter visible, button 6, button7 and button8 are missing

The first FlowLayoutPanel are fully visible, but the second is only quarter visible, button 6, button7 and button8 are missing

As you see, i'm not satisfied from this behavior. Is there something i can do to get all this work?

+1  A: 

It looks to me like a bug... you could report it to Microsoft.

One possible workaround: try to use tableLayoutPanel instead of your outer 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, ...
_simon_
Thanks! this is working, except the ugly animation on resizing, but it layouts without bugs! :-)
DxCK