Reputation: 20046
I try to create a window with rounded corner. I set Window background to transparent and set the border background to white. However on the region between the border and the window, I get black background instead of transparent.
I develop on C# WPF, VS2010 on Window 7. Below is my XAML and Screenshot.
XAML:
<Window WindowStyle="None" Background="Transparent">
<Border BorderBrush="Black" BorderThickness="1" CornerRadius="25" Background="White">
<Grid>
... some content ...
</Grid>
</Border>
</Window>
Screenshot:
Upvotes: 36
Views: 22887
Reputation: 132648
You also need to set AllowsTransparency="True"
on your Window
tag to use a Transparent Window Background
<Window WindowStyle="None"
Background="Transparent"
AllowsTransparency="True">
</Window>
Upvotes: 72