private void main_FormClosing(object sender, FormClosingEventArgs e)
        {
             if (e.CloseReason == CloseReason.UserClosing)//当用户点击窗体右上角X按钮或(Alt + F4)时 发生

          
            {
                if (  MessageBox.Show("确定退出?", "退出程序", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK)
                {
                    //count += 1;
                    //    e.Cancel = true;

                    Application.Exit();
                   
                   
                }
            }
        }

相关文章:

  • 2021-08-08
  • 2022-12-23
  • 2021-05-12
  • 2021-09-06
  • 2021-09-16
  • 2022-01-20
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案