是否可以使用 Windowsform 的 Close[X]box 跳过验证?像这样的按钮,当点击时跳过验证
private void button1_Click(object sender, EventArgs e)
{
AutoValidate = AutoValidate.Disable;
Close();
}
是否可以使用 Windowsform 的 Close[X]box 跳过验证?像这样的按钮,当点击时跳过验证
private void button1_Click(object sender, EventArgs e)
{
AutoValidate = AutoValidate.Disable;
Close();
}
https://stackoverflow.com/a/16544523/2322994
protected override void WndProc(ref Message m) {
// Intercept WM_SYSCOMMAND, SC_CLOSE
if (m.Msg == 0x112 && (m.WParam.ToInt32() & 0xfff0) == 0xf060) this.AutoValidate = AutoValidate.Disable;
base.WndProc(ref m);
}