代码如下:

<Window x:Class="WpfApp1.Test1"
        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"
        xmlns:local="clr-namespace:WpfApp1"
        mc:Ignorable="d"
        Title="Test1" Height="566" Width="980" WindowStyle="None" WindowChrome.WindowChrome="{DynamicResource WindowChromeKey}">
  <!-- WindowStyle="None":去除窗体边框,WindowChromeKey去除上白边 -->
    <Window.Resources>
        <WindowChrome x:Key="WindowChromeKey">
            <WindowChrome.CaptionHeight>0</WindowChrome.CaptionHeight>
            <!-- <WindowChrome.ResizeBorderThickness>
                <Thickness>1</Thickness>
            </WindowChrome.ResizeBorderThickness> -->
        </WindowChrome>
    </Window.Resources>
</Window>

 

 

作者:꧁执笔小白꧂