private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{//捕捉窗体Close事件,关闭窗口时提示
if (MessageBox.Show("请您确认是否退出(Y/N)", "系统提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
{
try
{
ShutdownWinIo();
}
catch (System.Exception error)
{//WinIO卸载失败异常
MessageBox.Show(error.Message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
e.Cancel = false;//允许退出系统
}
else
{
e.Cancel = true;//阻止退出系统
}
}
文章评论(0条评论)
登录后参与讨论