---
title: "The GroupBox Control in C#.Net"  
description: "The GroupBox Control in C#.NetThe GroupBox control is a containercontrol that is used to place Windows Forms child controls in a group. That is the"  
author: "Anonymous User"  
published: 2011-01-24  
updated: 2020-07-11  
canonical: https://www.mindstick.com/articles/401/the-groupbox-control-in-c-sharp-dot-net  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# The GroupBox Control in C#.Net

## 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.

![GroupBox Control in C#.Net](https://www.mindstick.com/mindstickarticle/30ac7608-a12d-43dd-a41b-a6a66f4d0467/images/a3b7ea49-b871-4204-a8bb-f2c63f6e3cbe.png)

You can insert other control inside GroupBox control.

![GroupBox Control in C#.Net](https://www.mindstick.com/mindstickarticle/30ac7608-a12d-43dd-a41b-a6a66f4d0467/images/e65cdc34-1c45-4334-b3bd-ad585069b782.png)

##### GroupBox Properties

**AutoSize:** Gets or sets a value that [indicates whether](https://www.mindstick.com/Articles/1132/auto-refresh-partial-view-in-asp-dot-net-mvc) 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](https://www.mindstick.com/articles/527/grid-control-in-wpf) be changed 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;}
```

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

##### Output

![GroupBox Control in C#.Net](https://www.mindstick.com/mindstickarticle/30ac7608-a12d-43dd-a41b-a6a66f4d0467/images/9efdec9d-b35a-4128-9049-32ea0e3760b3.png)

\

---

Original Source: https://www.mindstick.com/articles/401/the-groupbox-control-in-c-sharp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
