I’m writing a .NET program that will be launched by an external application in the minimized state (i.e. the other app sets WindowStyle to Minimized in the ProcessStartInfo structure it uses to start my program).
I want to pop up a form in the middle of the screen with ShowDialog(), but the form insists on staying minimized until I click its taskbar icon. I’ve tried setting the form’s WindowState property, but even though the property value changes from Minimized to Normal, the form stays minimized.
I have noticed, however, that when I call MessageBox.Show(), that box appears in the middle of the screen, so there must be some way to do it.
In Delphi, I’d call Application.Restore() to unminimize the whole program, but I don’t see an equivalent in .NET. How can I make my form appear without having to unminimize it by hand?