以前写过一个,有点笨:)
让窗体关闭按钮无效

呵呵,这个简单:
        protected override void WndProc(ref Message m)
        {
            
base.WndProc(ref m);
            
// 0x84 : WM_NCHITTEST
            if (m.Msg == 0x84
            {
                
// 20   : HTCLOSE
                if (m.Result == (IntPtr)20
                {
                    
// 0    : HTNOWHERE
                    m.Result = (IntPtr)0;
                }
            }
        }

MDI 窗体有效。

相关文章: