2010-07-19 78 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