边界三边

有没有办法只在顶部、左侧和右侧创建边框?

34585 次浏览

Yes:

<Border BorderThickness="1 1 1 0" BorderBrush="Black"/>

Same as goes for Margin, Padding etc.

And just for fun, to do so in code:

var b = new Border();
b.BorderThickness = new Thickness{Top=1, Bottom=0, Left=1, Right=1};