---
title: "GroupBox control in WPF"  
description: "The XAML(Extensible Application Markup Language)  element represents GroupBox control in WPF. The GroupBox control allows you to visually group cont"  
author: "Anonymous User"  
published: 2011-04-01  
updated: 2020-03-04  
canonical: https://www.mindstick.com/articles/525/groupbox-control-in-wpf  
category: "wpf"  
tags: ["wpf"]  
reading_time: 2 minutes  

---

# GroupBox control in WPF

The XAML(Extensible Application Markup Language) **<GropuBox />** element represents GroupBox control in WPF. The GroupBox control allows you to visually group content and provides a title for grouped elements. In the title bar, we can display the expand/collapse button allowing you to temporarily hide the content. Groupbox control is derived from [ContentControl](https://www.mindstick.com/articles/542/tab-control-in-wpf) which has a single element in his body. In simple words, we can say GroupBox is used to represent a container that has both single element content and a single element header. In this demonstration, I will show you how to use GroupBox control in WPF.\

##### The following code snippet represents the use of group box control

```
<GroupBox Header="Select Your Course" Height="258" HorizontalAlignment="Left" Margin="65,51,0,0" Name="groupBox1" VerticalAlignment="Top" Width="381">            <Grid>                <CheckBox Content="GNIIT Software Track" Height="16" HorizontalAlignment="Left" Margin="56,27,0,0" x:Name="chkGniitcourse" VerticalAlignment="Top" />                <CheckBox Content="B.Sc.(I.T.) Degree Program" Height="16" HorizontalAlignment="Left" Margin="56,61,0,0" x:Name="chkBscitCourse" VerticalAlignment="Top" />                <CheckBox Content="DNIIT Diploma Program" Height="16" HorizontalAlignment="Left" Margin="56,95,0,0" x:Name="chkDniitCourse" VerticalAlignment="Top" />                <CheckBox Content="Hardware And Networking" Height="16" HorizontalAlignment="Left" Margin="56,130,0,0" x:Name="chkHardwareCourse" VerticalAlignment="Top" />                <Button Content="Ok" Height="23" HorizontalAlignment="Left" Margin="56,169,0,0" x:Name="btnCourse" VerticalAlignment="Top" Width="253" />            </Grid></GroupBox>
```

##### In the following code snippet, we mention the following points.

- Name—Name property is used to provide a unique name to your group box control.
- Header—Header property is used to provide heading to your group box control.

In this group box control, I had added 4 [checkbox and one-button](https://www.mindstick.com/articles/541/datepicker-control-in-wpf) control.

##### The output of the following code snippet is as follows

![GroupBox control in WPF](https://www.mindstick.com/mindstickarticle/6178a9d1-66ce-4f86-8b07-52594aa78135/images/97d298bf-0e24-4633-a5c3-390b7e297726.png)

---

Original Source: https://www.mindstick.com/articles/525/groupbox-control-in-wpf

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
