WPF-无边框并去除上白边

代码如下:

<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>

 

posted @   ꧁执笔小白꧂  阅读(515)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· 一文读懂知识蒸馏
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
点击右上角即可分享
微信分享提示