Dot-Net

啟動時完全隱藏 WPF 視窗?

  • July 14, 2011

我希望我的視窗在啟動時完全隱藏。沒有視窗,工作列中沒有條目。使用者沒有看到,應用程序已啟動。

我怎麼能意識到這一點?

謝謝!

HB 方法的替代方法是將 設置Visibility為隱藏並設置ShowInTaskbar為 false。這仍然會創建視窗並讓它做它的事情。

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

引用自:https://stackoverflow.com/questions/6690848