It is 2010 now and while we are enjoying new presentation technologies like Silverlight, nobody can guarantee us we won't deal with more then three years old bugs in WinForms.

Recently I was working on one small desktop application that displays dynamically created content in the FlowLayoutPanel control. In some cases, when you add two controls and the first one has FlowBreak set to true, the FlowLayoutPanel can add unwanted space between the controls.

It seems the height of the gap is the same as the height of the second control following after the flow break. And the workaround to get rid of the gap is to add an additional panel of zero size just after the flow break.

I found this workaround in the Windows Forms General forum.

Comments

safor wrote 5/6/2010 at 4:12 PM Another issue with the FlowLayoutPanel is absence of the mouse wheel support. Here is a solution: http://www.thewayofcoding.com/tag/flowlayoutpanel/