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?
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>
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With