What is the “right” way to bring a Windows Forms Application to the foreground?

Have you tried Form.Activate?

This code seems to do what you want, by restoring the form to normal size if minimized and then activating it to set the focus:

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

this.Activate();

Warning: this is annoying! If it’s just an app for your personal use, as you say, maybe you can live with it. 🙂

Leave a Comment