启动时完全隐藏WPF窗口吗? [英] Completely hide WPF window on startup?

查看:66
本文介绍了启动时完全隐藏WPF窗口吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的窗口在启动时完全隐藏.无窗口,任务栏中无条目.用户看不到,应用程序已启动.

I want that my window is completely hidden on the startup. No window, no entry in the taskbar. The user doesn't see, the application is started.

我怎么能意识到这一点?

How can I realize that?

谢谢!

推荐答案

HB方法的一种替代方法是将 Visibility 设置为隐藏,然后将 ShowInTaskbar 设置为错误的.这仍然会创建窗口并让其执行操作.

An alternative to H.B.'s method is just to set the Visibility to hidden and set ShowInTaskbar to false. This still creates the window and lets it do its thing.

<Window x:Class="WpfApplication2.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" ShowInTaskbar="False" Visibility="Hidden">
    <Grid>

    </Grid>
</Window>

这篇关于启动时完全隐藏WPF窗口吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆