如何使StackPanel具有底边框并且厚度为1?
我尝试了几种方法,其中一种方法是在下面,但我没有尝试过任何工作(包括我在SO上找到的一些答案):
<Border BorderBrush="#FF1986D1" BorderThickness="1" VerticalAlignment="Bottom">
<StackPanel Background="#FFC6E1EE" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="13">
</StackPanel>
</Border>
答案 0 :(得分:6)
我明白了:
<Window x:Class=".MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="" Height="558" Width="328">
<Grid>
<Border BorderBrush="#FF1986D1" BorderThickness="0 0 0 1" VerticalAlignment="Top">
<StackPanel Background="#FFC6E1EE" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="113">
</StackPanel>
</Border>
</Grid>
</Window>