轉-關閉前的提示

摘要:轉-關閉前的提示


 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)
            {
                // 顯示MessageBox 
                DialogResult Result = MessageBox.Show("確定關閉DA", "DA訊息", MessageBoxButtons.YesNo);
                if (Result == System.Windows.Forms.DialogResult.Yes)
                {
                    // 關閉Form 
                    this.Close();
                }
                else
                {
                    return;
                }
            }
            base.WndProc(ref m);
        }

 

 

 

 

 

 

大家一起加入blogads 賺零用錢!!