你好,
如果希望两个控件之间相邻的边框有颜色,可以试试下面的做法,将这两个控件不相邻的边框宽度设置为零:
<Grid Name="grid1">
<Grid.RowDefinitions >
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" Background="AliceBlue" Width="100" Height="100" VerticalAlignment="Bottom">
<Border BorderThickness="0,0,0,2" BorderBrush="Red"/>
</Grid>
<DockPanel Grid.Row="1" Background="Ivory" Width="100" Height="100" VerticalAlignment="Top">
<Border BorderThickness="0,2,0,0" BorderBrush="Red"/>
</DockPanel>
</Grid>
效果图:

Best Regards,
Annievia Chen
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to
MSDN Support, feel free to contact MSDNFSF@microsoft.com.