Home > DeveloperSection > Articles > GroupBox Control in C#.Net

GroupBox Control in C#.Net


C# C# 
Ratings:
0 Comment(s)
 9799  View(s)
Rate this:

GroupBox Control in C#.Net


A GroupBox control is a container control that is used to place Windows Forms child controls in a group. The purpose of a GroupBox is to define user interfaces where we can categories related controls in a group. 

How to use 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 C#.Net

You can insert other control in side GroupBox control.

GroupBox Control in C#.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: ForeColor of all control in side GroupBox can be change at a time.

 

Example:

private void GroupBox_Load(object sender, EventArgs e)

{

            //Change Fore color of all control in side GroupBox

            groupBox1.ForeColor = Color.RoyalBlue;

}

Fore color of all control in side GroupBox will be change when apllication run.

Output

GroupBox Control in C#.Net


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

Follow MindStick