articles

Home / DeveloperSection / Articles / The GroupBox Control in C#.Net

The GroupBox Control in C#.Net

The GroupBox Control in C#.Net

Anonymous User 22674 24-Jan-2011

The GroupBox Control in C#.Net

The GroupBox control is a container control that is used to place Windows Forms child controls in a group. That is 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 the toolbox on the window Form. When you drag and drop the group box, it has a border by default, and its caption is set to the name of the control. You can change its caption.

The GroupBox Control in C#.Net

You can insert other control inside GroupBox control.

The 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 inside GroupBox can be changed at a time.

 Example:

private void GroupBoLoad(object sender, EventArgs e)
{
            //Change Fore color of all control in side GroupBox
            groupBox1.ForeColor= Color.RoyalBlue;
}

The Fore color of all control inside GroupBox will be changed when the application run.

Output

The GroupBox Control in C#.Net



c# c# 
Updated 11-Jul-2020
I am a content writter !

Leave Comment

Comments

Liked By