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)
            {
                //取消terbox1的验证事件
                this.textBox1.CausesValidation = false;
                ComDB.CloseConn();
                this.Close();
                return;
            }
            base.WndProc(ref m);
        }
  ////关闭窗体
posted on 2009-02-12 16:22  也风  阅读(149)  评论(0编辑  收藏  举报