0

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.

Hussain Halai
  • 49
  • 2
  • 11
  • 2
    http://stackoverflow.com/questions/1052913/how-to-detect-when-a-windows-form-is-being-minimized – Habib May 04 '13 at 14:41
  • please show some source code... what have you tried ? what is your goal exactly ? what is not working (error messages/exception) ? – Yahia May 04 '13 at 14:41
  • look at the link in the first comment (just read it and my answer was quite the same that the one in this post) – ppetrov May 04 '13 at 14:48

1 Answers1

2

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


    }
Neeraj Dubey
  • 4,401
  • 8
  • 30
  • 49