Domanda

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.

È stato utile?

Soluzione

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


    }
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top