在WPF网格底部的边界

我有一个关于WPF Grid Control的非常简单的问题。

我想在网格中的每一行设置一个底部边框,但只能find如何将每个单元格周围的所有4个边框..我的代码是非常简单的

<Grid Height="174" HorizontalAlignment="Left" Margin="23,289,0,0" Name="grid2" VerticalAlignment="Top" Width="730"> <Grid.RowDefinitions> <RowDefinition Height="45" /> <RowDefinition Height="25" /> <RowDefinition Height="25" /> <RowDefinition Height="25" /> <RowDefinition Height="25" /> <RowDefinition Height="25" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="255" /> <ColumnDefinition Width="95" /> <ColumnDefinition Width="95" /> <ColumnDefinition Width="95" /> <ColumnDefinition Width="95" /> <ColumnDefinition Width="95" /> </Grid.ColumnDefinitions> </Grid> 

对于我正在使用的另一个网格,需要使用所有四个边框

 <Border Grid.Column="0" Grid.Row="0" BorderBrush="#61738B" BorderThickness="1" /> 

PS网格的内容是一些标签,文本框等。

欣赏任何指针。

中号

Border控件上您可以执行BorderThickness="0 0 0 1"以仅显示底部边框。

顶部和底部边框厚度为5,左右边框厚度为0

BorderThickness="0 5"

顶部和底部边框厚度为0,左右边框厚度为5

BorderThickness="5 0"

边框厚度 – 左:1,顶部:2,右:3,底部:4

BorderThickness="1 2 3 4"

希望这可以帮助!

我很幸运,通过在网格节点周围包含BorderThickness="0 1 0 1"的边界节点,将下边框放在整行上。 喜欢这个:

 Border Style="{StaticResource ItemBorderStyle}" BorderThickness="0 1 0 1" Grid Style="{StaticResource GridItemStyle}"