首页 > 学院 > 开发设计 > 正文

winform程序关闭界面时弹出提示框

2019-11-17 02:33:57
字体:
来源:转载
供稿:网友

winform程序关闭界面时弹出提示框

void Form1_FormClosing(object sender, FormClosingEventArgs e){    if (MessageBox.Show(            "窗口关闭后,数据即将丢失!是否现在关闭窗口",            "提示",             MessageBoxButtons.OKCancel,             MessageBoxIcon.Question) != DialogResult.OK)            {                e.Cancel = true;                return;            }} 

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表