I am adding some controls to Flow layout panel. In between some controls I need a line break. How can I achieve this please. Thanks
Asked
Active
Viewed 1.8k times
3 Answers
47
After adding the last control before the break, call flow.SetFlowBreak(lastControl, true)
.
Note: lastControl
is the control that you want set new line after that.

John Hatton
- 1,734
- 18
- 20
-
15Or, to set FlowBreak from the VS2010 GUI: Scroll to the bottom of the **PropertyPanel** for the control before the line break, and set **FlowBreak** to **True**. – Brian Gillespie May 18 '12 at 16:22
13
The best answer is by far the comment made by Brian Gillespie:
Set FlowBreak from the VS2010 GUI: Scroll to the bottom of the PropertyPanel for the control before the line break, and set
FlowBreak
toTrue
.
-
4... and note that the FlowPanel must have its `WrapContents` property set to `True` – g t Oct 04 '12 at 07:51
-
1
0
You need a custom control which resizes itself to the end of a flow panel, and has a zero height / width, depending upon the flow direction of a flow panel

Alan Turing
- 2,482
- 17
- 20
-
Lets say I am using a Label without a caption, is there a way to identify the width of the label. – dps123 Feb 20 '11 at 01:51
-
I think this is a terrible solution, for it involves creating a custom control and code, while there is an alternative available that involves no code and was clearly intended for exactly this purpose. (See the answer given by Zyo, and the comment by Brian Gillespie.) – Joeppie Oct 29 '15 at 13:11
-
-
The question is a tad vague, thus the best answer is a likely a combination of the above. Artur's answer was accepted by the owner of the question without anyone stating/clicking the answer as useful... that's unfortunate. If you are "adding some controls" programmatically, then you can't use the Property Panel. John, Brian and Artur all have good input... depending on how you're putting the controls in the FlowLayoutPanel. This stuff is a little tricky. – TravelDev Dec 09 '22 at 00:27