开发者

WPF, ShowGridLines equivalent for wrap panel

I need to display a 1 pixel wide border around all wrap panel cells, kinda like excel grid. Unfortunately t开发者_StackOverflowhe wrap panel does not implement the grid ShowGridLines property. I can't put a border inside every cell because adjacent cells will have a 2 pixel border instead of 1 pixel.

Since the wrap panel arranges it's layout dynamically and does not expose it's properties I can't evaluate the correct value for a border inside a cell. Any workaround possible?


There is no way to show grid lines because it's just not a grid. Even in a WPF grid control, you have very little control over the appearance of lines: How can I change the color of the gridlines of a Grid in WPF?. They're really just for debugging. The workaround is to put a border inside each cell that only has thickness on the bottom and on the right: BorderThickness="0,0,1,1"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜