问题
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
回答1:
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
回答2:
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.
回答3:
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
.
来源:https://stackoverflow.com/questions/5054622/c-sharp-flow-layout-panel-line-break-or-new-line