Reputation: 51958
So the Rectangle control has RadiusX and RadiusY property for making rounded corners. However, this affects ALL corners but I'd like to know if there's a way to just affect the top corners, or the bottom corners, etc. Is there a way?
Upvotes: 6
Views: 7016
Reputation: 38385
Take a look at the Border control CornerRadius property:
<Grid Width="100" Height="100">
<Border
BorderBrush="SlateBlue"
BorderThickness="5,10,15,20"
Background="Tomato" Padding="5"
CornerRadius="5,10,15,20">
<Rectangle Fill="Yellow" />
</Border>
</Grid>
Upvotes: 12
Reputation: 1056
You can overlay two rectangle, one on top of the other. On the bottom rectangle, set the RadiusX and RadiusY properties, on the top rectangle keep them unset and then move it over the rounded top or bottom.
Make them the same color and it will look like a single rectangle with only the top or bottom rounded.
Upvotes: 1