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

GroupBox Control in VB.Net


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

GroupBox Control in VB.Net

GroupBox is a container of other control. It displays a frame around a group of controls. When you move the GroupBox control, all of its contained will also move.

How use the GroupBox Control

Drag and drop GroupBox control from toolbox on the window Form. When you drag and drop group box, it has a border by default, and its caption is set to the name of the control. You can change its caption.

GroupBox Control in VB.Net

GroupBox is a container of other control.

GroupBox Control in VB.Net

GroupBox properties

AutoSize:  Gets or sets a value that indicates whether the GroupBox resizes based on its contents.

BackColor: Gets or sets the background color for the control. 

ForeColor:Change ForeColor of all control in side GroupBox

You can change ForeColor of all control in side GroupBox at a time.

Code should be written inside Form Load so that when Form run then code (for changing Fore Color) will be executed.

For example:

Private Sub Form24_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        'Change Fore color of all control in side GroupBox

        GroupBox1.ForeColor = Color.Blue

 End Sub

Fore color of all control in side GroupBox will be cahnge When Application run.

Output:

GroupBox Control in VB.Net


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

Follow MindStick