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

FlowLayoutPanel Control in VB.Net


VB.Net VB.Net 
Ratings:
0 Comment(s)
 13821  View(s)
Rate this:

FlowLayoutPanel Control in VB.Net

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


Don't want to miss updates? Please click the below button!

Follow MindStick