WPF Rectangle draw border

Viewed 41564

I need to draw dashed border in Grid Cell. I figured it out using Rectangle, but I need to show only rectangle's bottom border without left, right, or top !!

    Rectangle r = new Rectangle();
    r.StrokeThickness = 1;
    r.Stroke = Brushes.Black;
    r.StrokeDashArray = new DoubleCollection() { 5 };
    r.StrokeDashCap = PenLineCap.Flat;

Thanks!!

2 Answers

Go to Properties -> Brush -> Stroke and select the border-related information:

enter image description here

Also in the Properties -> Appearance section you can do additional customizations over the border/stroke.

Related