Question: I've create a c# winforms form,

It has a bunch of labels positioned and a flowlayoutpanel.

on certain occasions i set one of the labels and the flowlayoutpanel to visible =false.

As a result i want all labels beneath them to be pushed up - at the moment there is a gap where they were.

Also, I'd like the flowlayoutpanel to grow and shrink depending on the number of items it has.
at the moment it is just the size i set it to be in the designer.

please can you help with these 2 issues.

Thanks

Answer: 
If I got you correctly, I would suggest using a TableLayoutPane with two rows. The top row will contain a docked panel with all the controls that may be hidden. The bottom row will contain a docked panel with all the rest.

Set the top row's SizeType to AutoSize and the bottom row's to 100%.

When you want to hide the controls, set the top panel's Visible property to false. Now, because the top row is AutoSized it will shrink to nothing, causing the bottom row to "jump" up.
The TableLayoutPanel does the pushing. Maybe you can use that if there is no better answer in next time.