<Window x:Class="WpfAppTest.GroupBoxWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfAppTest"
        mc:Ignorable="d"
        Title="GroupBoxWindow" Height="450" Width="800" Loaded="Window_Loaded">
        <Grid>
                <!-- 分组控件  内容控件   只能有一个元素作为它的Content
                     如果我想在它的内部呈放多个子元素????   ——布局控件   -容纳多个元素
                -->
                <GroupBox  Header="导航菜单"  Width="200"  Height="200" BorderThickness="2" BorderBrush="Red">
                        <StackPanel>
                                <Label Content="这是一个GroupBox控件"/>
                                <Label Content="这是一个GroupBox控件"/>
                                <Label Content="这是一个GroupBox控件"/>
                                <Label Content="这是一个GroupBox控件"/>
                        </StackPanel>
                </GroupBox>
                <GroupBox  Header="导航菜单2"  Width="221"  Height="200" BorderThickness="2" BorderBrush="Red" Margin="32,110,0,0" HorizontalAlignment="Left"  VerticalAlignment="Top" Name="gbInfo">
                        <StackPanel Orientation="Vertical" >
                                <StackPanel Orientation="Horizontal" >
                                        <Label Content="用户名:"/>
                                        <TextBox Name="txtUserName" Text="userName"  Width="150"/>
                                </StackPanel>
                                <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
                                        <Label Content="密码:"/>
                                        <PasswordBox Password="123456"  Width="150"/>
                                </StackPanel>
                        </StackPanel>
                </GroupBox>
        </Grid>
</Window>