简体   繁体   English

Silverlight中网格的圆角

[英]Rounded corners of a grid in Silverlight

I'm trying to set the rounded corners of my grid. 我正在尝试设置网格的圆角。 The cells inside the grid have set their own background color values. 网格内的单元格已设置了自己的背景色值。 Because of that, when I specify the border around the grid to have rounded corners, I get an awful result - the grid is NOT clipped to fit the border. 因此,当我将网格周围的边界指定为圆角时,会得到可怕的结果-网格没有被裁剪以适合边界。

So as to that, the corners of my grid go outside the border. 因此,我的网格的角在边界之外。

What is the solution for that problem? 该问题的解决方案是什么?

Thanks! 谢谢!

You should instead use a border and place the grid inside it. 相反,您应该使用边框并将网格放置在其中。 Set the grid background transparent and then set the color on the border. 将网格背景设置为透明,然后在边框上设置颜色。 The border can have rounded edges so then the background will be clipped to those rounded edges. 边框可以具有圆形边缘,因此背景将被剪裁到那些圆形边缘。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM