问题描述
我有一个 WPF 应用程序
I have a WPF application with
- 主窗口不是工具窗口
- 从主窗口启动一个具有 WindowStyle="ToolWindow" ShowInTaskbar="False" 的子窗口
现在在 Alt+Tab 中看不到主窗口和子窗口.[子窗口未出现在 alt+tab 中是预期行为,但主窗口应该可见]
Now BOTH Main Window and Child Window are not visible in Alt+Tab. [Child window not appearing in alt+tab is expected behavior,but Main window should be visible]
任何帮助将不胜感激.相关链接:http:///social.msdn.microsoft.com/Forums/en-US/wpf/thread/95e076a3-3030-4dc0-ab23-a7e489b2a160
Any help would be appreciated.Related link:http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/95e076a3-3030-4dc0-ab23-a7e489b2a160
推荐答案
使用 Show 时,它在我的机器 (Windows 7) 上按预期工作:
It works as expected on my machine (Windows 7) when using Show:
Window child = new Window();
child.Owner = this;
child.WindowStyle = WindowStyle.ToolWindow;
child.ShowInTaskbar = false;
child.Show();
使用 ShowDialog 时,会出现此问题.但是,我想知道将 ToolWindow 显示为对话框是否有意义 - 工具窗口通常没有对话框.
When using ShowDialog, the issue occurs. However, I am wondering whether it makes sense to show a ToolWindow as Dialog - Tool Windows are usually no dialogs.
这篇关于Wpf 工具窗口样式应用程序在 alt+tab 中不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!