To get to before , the form has been minimized, you have to connect to the WndProc procedure:
private const int WM_SYSCOMMAND = 0x0112; private const int SC_MINIMIZE = 0xF020; [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] protected override void WndProc(ref Message m) { switch(m.Msg) { case WM_SYSCOMMAND: int command = m.WParam.ToInt32() & 0xfff0; if (command == SC_MINIMIZE) {
To respond afterwards , the form was minimized in the case of the Resize event, as other answers indicate (included here for completeness):
private void Form1_Resize (object sender, EventArgs e) { if (WindowState == FormWindowState.Minimized) {
ChrisF Jun 27 '09 at 14:33 2009-06-27 14:33
source share