C# change location of controls inside FlowLayoutPanel

Ron picture Ron · Feb 17, 2011 · Viewed 7.2k times · Source

I am using flowLayoutPanel to have relative location controls. I would like to change the location of control inside the flowLayoutPanel. when I say location, I dont mean control1 before control2 or something like that - I mean that if I got 2 controls, lets say label and comboBox - the comboBox's height is 21, the label's height is 13 and the flowLayoutPanel's height is 21 also. I want to put the label in the vertical middle of the flowLayoutPanel - ((21-13)/2) from top. I dont want something specific for vertical middle I want general solution.

Answer

Ken Wayne VanderLinde picture Ken Wayne VanderLinde · Feb 18, 2011

You could also set the top margin of the label to (containerHeight-labelHeight)/2