WPF rectangle - round just top corners
问题 How can I have just the top corners rounded for a WPF rectange? I created a border and set the CornerRadius property and inside the border I've added my rectangle, but it doesn't work, the rectangle is not rounded. <Border BorderThickness="1" CornerRadius="50,50,0,0" BorderBrush="Black"> <Rectangle Fill="#FF5A9AE0" Stretch="UniformToFill" ClipToBounds="True"/> </Border> 回答1: The problem you've got is that the rectangle is "overflowing" the rounded corners of your border. A rectangle can't