Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create a dashed border with rounded corners in WPF?

The Rectangle element has StrokeDashArray which allows it to be drawn with dashes, but it doesn't support rounded corners. The Border control supports nice thick lines with rounded corners, but will only draw solid lines.

What's the best way to achieve a dashed border with rounded corners, with any control?

Example of dashed border http://img524.imageshack.us/img524/3186/dashedborder.png

like image 680
GraemeF Avatar asked Jun 26 '09 09:06

GraemeF


1 Answers

You are mistaken that Rectangle does not support this:

<Rectangle StrokeDashArray="0.5 1.0 0.3" Stroke="Black" StrokeThickness="2" RadiusX="10" RadiusY="10"/> 

enter image description here

like image 111
Kent Boogaart Avatar answered Sep 22 '22 19:09

Kent Boogaart