手机
当前位置:查字典教程网 >编程开发 >C#教程 >c# 关闭窗体时提示的小例子
c# 关闭窗体时提示的小例子
摘要:复制代码代码如下:privatevoidWorkflowConfigure_FormClosing(objectsender,FormClo...

复制代码 代码如下:

private void WorkflowConfigure_FormClosing(object sender, FormClosingEventArgs e)

{

DialogResult result = MessageBox.Show("此操作会丢弃您的当前设置,确定要继续?", "退出", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

if (DialogResult.Yes == result)

{

e.Cancel = false; // Cancel属性如果为true,表示取消该事件的执行。

}

else

{

e.Cancel = true;

}

}

【c# 关闭窗体时提示的小例子】相关文章:

c#进度条 progressBar 使用方法的小例子

C#简单获取时间差的小例子

C#位移的介绍与例子

c#判断输入的是不是数字的小例子

C# 撒列实现关键字过滤的实例

c# 匿名方法的小例子

c#固定长度的随机字符串例子

C# 委托(delegate) 的小例子

c# winform 关闭窗体时同时结束线程实现思路

C# 动画窗体(AnimateWindow)的小例子

精品推荐
分类导航