28

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)

Jowen
  • 5,203
  • 1
  • 43
  • 41

1 Answers1

74

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.

Bryan Anderson
  • 15,969
  • 8
  • 68
  • 83