Organizing Controls with the GroupBox Control

The WPF GroupBox control has the same purpose for same named controls in other technologies, offering a container with a header and a border for grouping nested controls. The following code shows how you can implement a GroupBox, assigning its headers and nesting controls:

<GroupBox Name="Group1" Margin="5">    <GroupBox.Header>        <TextBlock Text="Set your options"/>    </GroupBox.Header>    <StackPanel Margin="10">        <CheckBox Name="Check3" Content="Set a single option"/>        <RadioButton Name="Radio3" Content="Use this"/>        <RadioButton Name="Radio4" Content="Use that"/>    </StackPanel></GroupBox>

Figure 29.9 shows the output of this code.

FIGURE ...

Get Visual Basic 2015 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.