The FlowLayoutPanel dynamically repositions the controls it contains. The FlowLayoutPanel also supports Scroll when the AutoScroll property is set to True.
Drag and drop FlowLayoutPanel from toolbox on the window Form.
When you drag and drop other control like Button, ListView and Label in FlowLayoutPanel then it will automatically arrange the control.
FlowLayoutPanel Properties
FlowDirection: You can also set Flow direction in which control will flow through Flow Direction property (LeftToRight, Top Down, RightToLeft, and Bottom Up).
Example:
private void frmFlowLayoutPanel_Load(object sender, EventArgs e)
{
//set the FlowDirection in which control will Flow
flowLayoutPanel1.FlowDirection=FlowDirection.TopDown;
}
BorderStyle: Border of FlowLayoutPanel can be set through BorderStyle properties.
AutoScroll: When AutoScroll property is set to True then FlowLayoutPanel supports Scroll. FlowLayoutPanel will show scroll bar when some control not fit in the specified area of FlowLayoutPanel.
Example:
private void frmFlowLayoutPanel_Load(object sender, EventArgs e)
{
//set autoscroll to true
flowLayoutPanel1.AutoScroll = true;
}
Leave Comment