adjust border on one specific side

走远了吗. 提交于 2019-12-10 00:37:58

问题


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:


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.



来源:https://stackoverflow.com/questions/499607/adjust-border-on-one-specific-side

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!