窗体执行最小化操作,执行Hide(),隐藏到托盘,然后单击托盘显示窗体;
执行代码:
WindowState = WindowState.Normal; Visibility = Visibility.Visible; Activate(); BringIntoView(); Topmost = true; SysTray_StateChanged(null, null);
效果只会在任务栏上显示图标,并不会显示窗体:
解决:
执行代码Show()
Show(); WindowState = WindowState.Normal; Visibility = Visibility.Visible; Activate(); BringIntoView(); Topmost = true; SysTray_StateChanged(null, null);
可以达到效果: