articles

Home / DeveloperSection / Articles / FlowLayoutPanel Control in VB.Net

FlowLayoutPanel Control in VB.Net

FlowLayoutPanel Control in VB.Net

Pushpendra Singh 24657 13-Dec-2010

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 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 (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:

FlowLayoutPanel Control in VB.Net

 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:

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


Updated 07-Dec-2019

Leave Comment

Comments

Liked By