代码如下:
<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.ResizeBorderThickness>
<Thickness>1</Thickness>
</WindowChrome.ResizeBorderThickness>
</WindowChrome>
</Window.Resources>
</Window>
标签:代码,白边,如下,去除,WPF,边框 From: https://www.cnblogs.com/qq2806933146xiaobai/p/17076832.html