By default, a GroupBox can have one child only but multiple child controls can be added by placing a container control on a GroupBox such as a Grid or StackPanel.
The GroupBox element in XAML represents a GroupBox control. The following code snippet creates a GroupBox control, sets its background and font. The code also sets the header by using GroupBox.Header.
- <GroupBox Margin="10,10,10,10" FontSize="16" FontWeight="Bold" Background="LightGray">
- <GroupBox.Header>
- C# Corner
- </GroupBox.Header>
- <TextBlock FontSize="14" FontWeight="Regular">
- This is a group box control content.
- </TextBlock>
- </GroupBox>
The output looks like the following windows where a group box is displayed with its content.
The content of a GroupBox can be any content including multiple child controls. If you need to place multiple controls, you may need to use a container control such as a panel or grid.
You can format a GroupBox header’s color and border thickness.
The following code example creates a GroupBox with an orange border with multiple controls.

Sujeet SumanPosted Sep 26, 2015, 1:35 AM
Nice Article....................