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

All 8 buttons are fully visible, but the panel forgot to compress http://img534.imageshack.us/img534/3575/panels1.png

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 8 is missing http://img301.imageshack.us/img301/5296/panels2.png

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 halfway visible, button 7 and button 8 are missing http://img697.imageshack.us/img697/4644/panels3.png

The first FlowLayoutPanel is fully visible, but the second is only displayed at a quarter, button 6, button 7 and button 8 are missing

The first FlowLayoutPanel is fully visible, but the second only shows a quarter, button 6, button7 and button8 are missing http://img168.imageshack.us/img168/6428/panels4.png

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







All Articles