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.

Was it helpful?

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");
        }


    }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top