H.B.的方法的替代方法只是将可见性设置为隐藏并将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>