GroupBox控件

GroupBox是这三个集成HeaderedContentControl类的控件中最简单的一个,它显示具有圆角和标题的方框

 

GroupBox仍需要布局容器(如SrackPanel面板)来布置内容,GroupBox控件经常用来对数量不多的相关控件进行分组,但GroupBox控件没有提供内置功能,因而可以随意使用

<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <GroupBox Header="group box title">
            <StackPanel>
                <RadioButton>1</RadioButton>
                <RadioButton>2</RadioButton>
                <RadioButton>3</RadioButton>
                <Button Width="100" HorizontalAlignment="Left">save</Button>
            </StackPanel>
        </GroupBox>
    </Grid>
</Window>