I use the following code to restore a WinForms app from the system tray:
this.WindowState = FormWindowState.Normal;
this.Show();
this.BringToFront();
I need to set the focus on a textbox when the window is shown. I do this in the OnActivated override and this works fine in general except when restoring from the tray with the code above. Debugging shows that OnActivated is not being called.
Any suggestions?
Thank you all.