winform画面Ctrl+F4实现最下化功能同时屏蔽关闭功能

 

在画面Class重写代码如下:

 

protected override void WndProc(ref Message m) { const int WM_SYSCOMMAND = 0x0112; const int SC_CLOSE = 0xF060; if (m.Msg == WM_SYSCOMMAND && (int)m.WParam == SC_CLOSE) { // User clicked close button this.WindowState = FormWindowState.Minimized; return; } base.WndProc(ref m); } 

你可能感兴趣的:(user,Class,button,WinForm)