How to draw a half-rounded rectangle?

I want a a half-rounded rectangle like in the image, but rounded only 2 edges.

A Half-Rounded Rectangle

I have tried using RadiusX="" RadiusY="", but that rounded all 4 edges.

Upvotes: 2

Views: 249

Answers (1)

mm8
mm8

Reputation: 169190

If you use a Border you can specify four different radiuses (topLeft, topRight, bottomRight, bottomLeft) separated by a comma, e.g.:

<Border BorderBrush="Blue" BorderThickness="3" CornerRadius="5,5,0,0" Margin="10">
    <TextBlock>....</TextBlock>
</Border>

Upvotes: 4

Related Questions