adjust border on one specific side

2019-04-17 21:43发布

I'm using a controlTemplate of the ListBox to show a collection. I want to display all the items with a border like in a grid (all lines same size). When I give every listBoxItem a border, the line between 2 items has a double size. (made from the bottom border of the first item, and the top border of the second item)

So the question is: Can I set/hide the border on a single side of an item? (like 'border-top' in css)

1条回答
时光不老,我们不散
2楼-- · 2019-04-17 22:46

The border property is a thickness, just like margin and padding, so you can do Border="2,0,2,2" to get a border of 2 everywhere except the top.

查看更多
登录 后发表回答