The FlowLayoutPanel dynamically repositions the controls it contains. The FlowLayoutPanel also supports Scroll when the
AutoScroll property is set to True.
Creating FlowLayoutPanel Control
Drag and drop FlowLayoutPanel from the toolbox on the window Form.
FlowLayoutPanel is a container of other control. When you drag and drop other control like button, textbox, and checkbox 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 (left to right, Top-Down, RightToLeft, and Bottom-Up).
For Example:
Private Sub Form23_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'set the FlowDirection in which control will Flow
FlowLayoutPanel1.FlowDirection = FlowDirection.TopDown
End Sub
Output:
AutoScroll: When AutoScroll property is set to True then FlowLayoutPanel supports Scroll. FlowLayoutPanel will show a scroll bar when some control is not fit in the specified area of FlowLayoutPanel.
For example:
Private Sub Form23_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'set autoscroll to true
FlowLayoutPanel1.AutoScroll = True
End Sub
Output:
BorderStyle: Border of FlowLayoutPanel can be set through BorderStyle properties. For example:
Private Sub Form23_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'set Border Style
FlowLayoutPanel1.BorderStyle = BorderStyle.FixedSingle
End Sub
Leave Comment