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)
If you want to set a border to just one side of the element, use four values (write none to the side you want no border to appear). If you want to set a border to the top and bottom sides, use two values (write none to the second value).
Yes you can. On the design tab, select Borders on the right side of the menu. Select the last option.
Select a word, line, or paragraph. On the Home tab, click the arrow next to the Borders button. In the Borders gallery, click the border style that you want to apply.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With