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 toolbox on the window Form.

FlowLayoutPanel Control in VB.Net

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 Control in VB.Net

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).

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:

FlowLayoutPanel Control in VB.Net

 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.

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:

FlowLayoutPanel Control in VB.Net

 

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

Output:

FlowLayoutPanel Control in VB.Net

  Modified On Mar-22-2018 07:16:15 AM

Leave Comment