A while back, I posted this question about trying to get a flowlayoutpanel to autosize properly when docked to the top of a container. What I was trying accomplish was to setup a horizontal (left-to-right) flowlayoutpanel spanning across the top edge of a form, and a datagridview taking up the rest of the available space below the flowlayoutpanel. I was having trouble getting the flowlayoutpanel's height property to autosize the way it should. The posted answer worked perfectly for what I was trying to accomplish, which was great...
Unable to leave well enough alone, I am now trying to go one step further and wrap the flowlayoutpanel in a UserControl. I've discovered, however, that doing this causes the flowlayoutpanel to no longer resize its height properly.
Here's the first layout, which works beautifully:
FlowLayoutPanel1 (Autosize = true, Dock = Top)
ComboBox1
ComboBox2
ComboBox3
DataGridView1 (Dock = Fill)
And here it is with flowlayoutpanel wrapped in a UserControl:
UserControl (Autosize = true, Dock = Top)
FlowLayoutPanel1 (Autosizse = true, Dock = Fill)
ComboBox1
ComboBox2
ComboBox3
DataGridView1 (Dock = Fill)
For whatever reason, flowlayoutpanel doesn't resize its height properly when the form is resized. This is pretty easy to reproduce. Oh also, the FlowLayoutPanel's contents can be anything, not just ComboBoxes.