简体   繁体   English

窗口最小化后不恢复

[英]Window is not restored after minimized

WPF window can't be restored from the taskbar or using Alt+Tab after being minimized (it stays minimized). WPF窗口在最小化后无法从任务栏或使用 Alt+Tab 恢复(它保持最小化)。 It happens on a part of environments (on my machine it's Ok but fails on some others).它发生在部分环境中(在我的机器上没问题,但在其他一些机器上失败)。

I can switch to the window from Task manager - then it gets restored.我可以从任务管理器切换到窗口 - 然后它就会恢复。

As a hotfix I added:作为修补程序,我添加了:

void Window_Activated(object sender, EventArgs e)
{
   ...
   if (this.WindowState == WindowState.Minimized)
   {
      this.WindowState = WindowState.Normal;
   }
}

It helped.它有帮助。 But I don't think that is the best solution.但我认为这不是最好的解决方案。 Have you any other ideas to fix it?您还有其他解决方法吗?

Seems the best existing solution so far is the one I found:到目前为止,似乎最好的现有解决方案是我发现的那个:

void Window_Activated(object sender, EventArgs e)
{
   ...
   if (this.WindowState == WindowState.Minimized)
   {
      this.WindowState = WindowState.Normal;
   }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM