I create a message box user control, radius for corner as below image, however, I cannot set transaparent for this user control. Please help me.
Thanks so much.
Update:
I've implemented as your instruction, but it isn't still transparent, I think that background's user control is white color, please help me. The below is my code:
<UserControl x:Class="Nanote.TestDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="200"
Height="200" Width="450"
d:DesignWidth="300"
mc:Ignorable="d">
<Border CornerRadius="20" BorderBrush="Black" BorderThickness="10"
Background="Transparent">
<Rectangle Fill="White" Margin="10" />
</Border>
</UserControl>
Consider the following XAML:
<Grid Background="Red">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid Margin="20">
<Border CornerRadius="20" BorderBrush="Black" BorderThickness="10"
Background="Transparent">
<Rectangle Fill="White" />
</Border>
</Grid>
<Grid Grid.Row="1" Margin="20">
<Rectangle Fill="White" />
<Border CornerRadius="20" BorderBrush="Black" BorderThickness="10"
Background="Transparent" />
</Grid>
<Border Grid.Row="2" CornerRadius="20" BorderBrush="Black" BorderThickness="10"
Background="White" Margin="20">
<Rectangle Fill="White" Margin="10" />
</Border>
</Grid>
This produces the following output:
Hopefully you can now work out your own solution from this example.
First set the background of your control to transparent then add border with radius(CornerRadius="10") , INSIDE that border you put the content GRID
<Border BorderBrush="Black" BorderThickness="1,1,1,1" Background="White" CornerRadius="10,10,10,10">
<Grid ></Grid>
</Border>
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