Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to place two labels in the same line in a TopDown FlowLayoutPanel? C#

I’m trying to place two labels together like in the picture (while maintaining a TopDown flow) in a FlowLayoutPanel. Is there any way to do this?

Diagram

I tried changing the flow direction to leftToRight for the two labels and changing it back to TopDown afterwards. It did not work.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

A FlowLayoutPanel only flows one way. Part of the point is that it will reflow as the content changes, so how could you have it flowing one way for specific controls and another way for others?

If you have configured your FlowLayoutPanel such that it can only have one control per row then it can only have one control per row. If you want two controls on one row then those two controls need to be children of another control and that parent is the one control that you add to the FlowLayoutPanel on that row. The parent could be Panel if you want to do it on an ad hoc basis, or you could create a dedicated user control.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading