虽然Form类没有提供Minimize的事件,但还是可以通过重载Deactive来实现
当Form失去焦点后,测试WindowState取得Form状态,若为Minimized既是最小化事件。
本例为最小化后隐藏窗口:

 


还有种方法更加直接,重载WndProc:

Winfrom 捕获窗体最小化事件const int WM_SYSCOMMAND = 0x112;
Winfrom 捕获窗体最小化事件
const int SC_CLOSE = 0xF060;
Winfrom 捕获窗体最小化事件
const int SC_MINIMIZE = 0xF020;
Winfrom 捕获窗体最小化事件
const int SC_MAXIMIZE = 0xF030;
Winfrom 捕获窗体最小化事件
protected override void WndProc(ref Message m)
}

Winfrom 捕获窗体最小化事件private void Form1_Deactivate(object sender, EventArgs e)
        }

相关文章:

  • 2022-01-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
  • 2022-01-27
  • 2022-12-23
相关资源
相似解决方案