WPF窗口隐藏(任务栏隐藏)

ShowInTaskbar="False" WindowState="Minimized" Visibility="Hidden"

一段代码就行了 加到哪看下面

复制代码
<Window x:Class="Binding.MainWindow"
        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:Binding"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800"
        ShowInTaskbar="False" WindowState="Minimized" Visibility="Hidden">
复制代码

 又或者把Height 和 Width 改成0 例如这样 顺便在业务代码里写一个

this.Hide();
复制代码
<Window x:Class="Binding.MainWindow"
        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:Binding"
        mc:Ignorable="d"
        Title="MainWindow" Height="0" Width="0"
        ShowInTaskbar="False" WindowState="Minimized">
复制代码

 

posted @   hack747  阅读(1428)  评论(1编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示