最佳答案
听起来您需要一个 GroupBox。我写了一篇关于这些的文章,但我不会发布链接,因为我不喜欢使用 StackOverflow 来推广网站。不过,我会发布开头示例 XAML,这样您就可以看到效果并检查它是否是您想要的。
<Window x:Class="GroupBoxDemo.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="GroupBox Demo"
Width="250"
Height="180">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<GroupBox Header="Mouse Handedness">
<StackPanel>
<RadioButton Content="Left-Handed" Margin="5"/>
<RadioButton Content="Right-Handed" Margin="5" IsChecked="True"/>
</StackPanel>
</GroupBox>
<GroupBox Grid.Row="1" Header="Double Click Speed">
<Slider Margin="5" />
</GroupBox>
</Grid>
</Window>
看起来像:
关于c# - WPF寻找方法来创建带有文本标签框架的边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18068033/