2010-07-19 85 views

回答

24

你以后在Windows中称为“GroupBox”。

我已经找到了如何使用它在C#角this example

<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> 

一组框只能包含一个直接孩子,所以如果你想要几个子控件,你必须将它们包装在一个网格或StackPanel。

有一个关于在MSDN组框的更多信息,它是Class PageHow to Style it