Resource

How to create a GroupBox in WPF?

Jun 09, 2009 Resources | WPF
A GroupBox control is used to add a header to an area and within that area you can place controls. By default, a GroupBox can have one child but multiple child controls can be added by placing a container control on a GroupBox such as a Grid or StackPanel.
  • 0
  • 0
  • 46899

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.

<Window x:Class="GroupBoxSample.Window1"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    Title="Window1" Height="300" Width="300">

    <Grid>

        <GroupBox Margin="10,10,10,10" FontSize="16" FontWeight="Bold"

                  Background="LightGray">

            <GroupBox.Header>               

               Mindcracker Network

            </GroupBox.Header>

           

            <TextBlock FontSize="12" FontWeight="Regular">

                This is a group box control content.               

            </TextBlock>            

        

        </GroupBox>

 

    </Grid>

</Window>

Soft Dev

Software developer working with WPF and Silverlight.

  • 150rank
  • 2M readers
COMMENT USING

PREMIUM SPONSORS

Hire Mobile & Web Developer on demand. 100% satisfaction. Try for 1 week or Money Back. Local and remote developers available all over USA.

TOP RESOURCES

MOST LIKED RESOURCES