private void Form1_Load(object sender, EventArgs e) { ApplicationHelper.CapturedExit <winMain>(this, () => { if (MessageBox.Show("确认退出?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { return(true); } return(false); }); }