[转][C#]关闭窗体
防止用户手动关闭窗体:
if ((e.CloseReason & System.Windows.Forms.CloseReason.UserClosing) == System.Windows.Forms.CloseReason.UserClosing)
e.Cancel = true;
防止用户手动关闭窗体:
if ((e.CloseReason & System.Windows.Forms.CloseReason.UserClosing) == System.Windows.Forms.CloseReason.UserClosing)
e.Cancel = true;