Question

What Event is used for Maximizing and Minimizing for Windows Form? I want to show message box when a Form maximizes and the from comes out of minimizing mode.

Était-ce utile?

La solution

This is Tested code

 private void Form1_Resize(object sender, EventArgs e)
    {
        if (WindowState == FormWindowState.Minimized)
        {
            MessageBox.Show("Minimize");
        }
        else if (WindowState == FormWindowState.Maximized)
        {
            MessageBox.Show("Maximize");
        }


    }
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top