c# how to FormWindowState.Normal

6.6k views Asked by At

i have this code:

    private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
    {
        this.WindowState = FormWindowState.Minimized;
        about About = new about();
        About.ShowDialog();
    }

it minimizes the parent window state to minimized and displays a splash form.

my question is when the splash screen closes how do i get back to parentwindowstate.normal?

3

There are 3 answers

0
Darin Dimitrov On BEST ANSWER
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
    this.WindowState = FormWindowState.Minimized;
    about About = new about();
    About.ShowDialog();
    this.WindowState = FormWindowState.Normal;
}
2
Lucas Jones On

Call ShowDialog() like this:

About.ShowDialog(this);

Then, in the About form's FormClosing event, put:

this.Parent.WindowState = WindowState.Normal;
0
MiffTheFox On

If you're using ShowDialog instead of Show; you can add

    this.WindowState = FormWindowState.Normal;

after the ShowDialog call. (ShowDialog is blocking, unlike Show.)