开发者

How to specify rectangle stroke only on left and right in WPF?

开发者 https://www.devze.com 2023-01-02 04:29 出处:网络
I wa开发者_开发百科nt to have rectangle that should have stroke only on left and right side(not on upper and lower side). How can I do it ?You can\'t - a rectangle only has a single stroke thickness.A

I wa开发者_开发百科nt to have rectangle that should have stroke only on left and right side(not on upper and lower side). How can I do it ?


You can't - a rectangle only has a single stroke thickness. A Border, though, uses a thickness structure that can have different thickness on each side:

<Border BorderThickness="5,0,5,0" BorderBrush="Black" />


you could use StrokeDashArray.

alternating between strokes at each vertex.

not perfect solution but with a bit of tweeking has worked well for me.

0

精彩评论

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