怎样在用户关闭窗体时控制窗体不关闭?
当然不是指加按钮控制的方法,而是用户点窗体右上角的小红叉时,怎么控制呢?
当然不是指加按钮控制的方法,而是用户点窗体右上角的小红叉时,怎么控制呢?
解决方案 »
- EntityFramework的数据怎么绑定到wpf的TreeView里
- 强类型的DataSet更新主从表的事物应该怎么写呢?
- excel导入数据 部分数据空白
- 急!如何读取dat文件
- 一般大家讨论‘打洞’技术的都是A和B之间传输数据包,有没有可能实现A、B、C....N 之间互通?
- 一个小问题,困扰我几天了。请帮忙解决
- C sharp中的return语句问题,请help me!!!超级SOS!!!
- 如何实现文件夹的缩略图显示
- winform中关于datagridview的问题
- 在这样的环境下,如何学习C#
- 往串口发送数据后,隔一秒后读取接收缓冲区,怎么设置定时器?Private Timer trmWait = new Timer()为什么不行?
- 画一个长方形框,在画时,随着鼠标移动,框也会自动改变大小,这应该怎么处理
{
// Determine if text has changed in the textbox by comparing to original text.
if (textBox1.Text != strMyOriginalText)
{
// Display a MsgBox asking the user to save changes or abort.
if(MessageBox.Show("Do you want to save changes to your text?", "My Application",
MessageBoxButtons.YesNo) == DialogResult.Yes)
{
// Cancel the Closing event from closing the form.
e.Cancel = true;
// Call method to save file...
}
}
}
{
e.Cancel =true;
}