I am trying to make the corners of a Window (WPF) rounded and it doesn't work, I tried to make the window itself transparent and add an internal border with rounded corners and it doesn't work.
Any ideas?
you need to set WindowStyle to WindowStyle.None, which will remove the chrome, then you can allow transparency which is an attribute int the Window element, and set the background color to transparent. All of this can be done as attributes to the window tag.
WindowStyle="None"
AllowsTransparency="True"
Background="Transparent"
To make the corners rounded, use a border and set the cornerRadius property
Don't use AllowsTransparency it's slow and buggy, take a look at this link, look for the section "Office 2007 without Aero – Or, you are responsible for everything":
https://blogs.msdn.microsoft.com/wpfsdk/2008/09/08/custom-window-chrome-in-wpf/
EDIT: some of the techniques in this post are specific to Vista, but the "Office 2007 without Aero" section works on XP (and actually describes what software that is written for Vista has to fall-back to on XP).
it may help u.
<Grid DataContext="{Binding ElementName=root}">
<Border Background="#90000000" Visibility="{Binding Visibility}">
<Border BorderBrush="Black" BorderThickness="1" Background="AliceBlue"
CornerRadius="10,0,10,0" VerticalAlignment="Center"
HorizontalAlignment="Center">
<Border.BitmapEffect>
<DropShadowBitmapEffect Color="Black"
Opacity="0.5" Direction="270"
ShadowDepth="0.7" />
</Border.BitmapEffect>
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock x:Name="MessageTextBlock"
Text="{Binding Message}"
TextWrapping="Wrap" Margin="5" />
<UniformGrid Grid.Row="1" Margin="5"
Columns="2" HorizontalAlignment="Center"
VerticalAlignment="Bottom">
<Button x:Name="OkButton"
Content="Ok" Margin="2" />
<Button x:Name="CancelButton"
Content="Cancel" Margin="2" />
</UniformGrid>
</Grid>
</Border>
</Border>
</Grid>
I solved this by Windows.Clip.
<Window ....
<Window.Clip>
<RectangleGeometry Rect="0,0,857,483" RadiusX="25" RadiusY="25"/>
</Window.Clip>
</Window>
But I think best way would be to use WindowChrome. You can solve resizing issue relatively easy. I am not finished with understanding this tech. So I can't post working solution right now. Here for the moment a link which seems to be useful. MS-Docs ChromeClass