How to remove white strip on top of WPF window with WindowStyle=None?

What you are seeing in white is the re-size border. You can remove that and still make the window resizable by setting ResizeMode="CanResizeWithGrip" AllowsTransparency="True"

If you dont want to resize at all then do this – ResizeMode="NoResize", again you wont see the border but you cant resize.

<Window x:Class="HandsOnSolution.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525" Background="Green" WindowStyle="None" ResizeMode="CanResizeWithGrip" AllowsTransparency="True">
    <Grid>
    </Grid>
</Window>

Edit

Good point by @devuxer, if you are interested in dragging you can add this piece of code to the window mouse down event

<Window MouseLeftButtonDown="Window_MouseLeftButtonDown"/>

//code behind
private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
    DragMove();
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)