C#WPF控件名称我找不到

时间:2016-04-10 19:23:41

标签: c# wpf border

我正在尝试制作一些字段并将它们放入一些“边框”中 但是,我正在搜索此图片中的“宠物”边框示例:
Border Example

2 个答案:

答案 0 :(得分:1)

它被称为GroupBox。

以下是如何使用它的一个很好的例子:

<Window x:Class="WpfApplication9.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="Pizza" HorizontalAlignment="Left" Margin="10,10,0,0"
          VerticalAlignment="Top" Height="236" Width="263">
        <Grid HorizontalAlignment="Left" Height="226" VerticalAlignment="Top"
          Width="253" Margin="0,0,-2,-12">
        <Label Content="These are some pizza toppings."
               HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,10,0,0"/>
        <CheckBox Content="Cheese" HorizontalAlignment="Left"
              Margin="10,41,0,0" VerticalAlignment="Top"/>
        <CheckBox Content="Mushrooms" HorizontalAlignment="Left"
              Margin="10,61,0,0" VerticalAlignment="Top"/>
        <CheckBox Content="Olives" HorizontalAlignment="Left"
              Margin="10,81,0,0" VerticalAlignment="Top"/>
        </Grid>
    </GroupBox>
    </Grid>
</Window>

取自:http://www.dotnetperls.com/groupbox-wpf

答案 1 :(得分:0)

这是您搜索的内容:GroupBox