简体   繁体   中英

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). 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;
   }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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