Naveen Raja
Naveen Raja

Reputation: 1

How to restore a window while it is minimized in system tray?

I have a wpf form which has one main window. when i click a button in main window it i will show a child window. I tried to restore the child window but couldn't. how to restore while it is minimized in system tray?

Upvotes: 0

Views: 503

Answers (1)

sexta13
sexta13

Reputation: 1578

Something like this should work

 if (this.MainWindow.WindowState == WindowState.Minimized)
 {
     this.MainWindow.WindowState = WindowState.Normal;
 }

 //bring window to front of all windows
 this.MainWindow.Activate();

this.MainWindow should be the reference to the window you want to maximize or bring to normal state.

Regards,

Upvotes: 2

Related Questions