2010-07-19 63 views

Trả lời

24

Những gì bạn đang được gọi là "GroupBox" trong Windows nói.

tôi đã tìm thấy this example làm thế nào để sử dụng nó trên C# Corner:

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

Một GroupBox chỉ có thể chứa một con trực tiếp, vì vậy nếu bạn muốn một số điều khiển phụ bạn sẽ phải quấn chúng trong một Lưới hoặc StackPanel.

Có thêm thông tin về các GroupBox tại MSDN, nó Class PageHow to Style it

Các vấn đề liên quan