菜鸟求助~~ 我在编写Windows应用程序的时候 系统ControlBox=True时;自己会有最小化最大化和关闭 我想在关闭是做一些事情但是我找不到关闭的Click事件 请问怎么才能在关闭时做出一些事情啊? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Form_FormClosing()事件中去做,如果不符合条件还可以不让关闭窗口 不知道怎么声明FormClosing() 我光写个FormClosing(){}好象没什么用 先加this.Closing += new System.ComponentModel.CancelEventHandler(this.Form1_Closing);然后private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e) { //你要做的事 } 在窗体的Closing事件中写上Form1_Closing,则你的代码中就会出现Form1_Closing 的格式,它的具体格式如下:private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e) { } 上面就是Form1_Closing的格式。 private void RemoveForm_FormClosing(object sender, FormClosingEventArgs e) { DialogResult dr; dr = MessageBox.Show("are you sure close the window", "Close window", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation); if (dr == DialogResult.OK) { Application.Exit(); } } 有关于获取DataGridView中数据的问题。 如何获取TabControl内动态生成的控件的属性? PictureBox文件关闭的问题 白捡份----vs.net DataGridView 中,怎么在单元格宽度一定时,调整行高,以容纳其内容? office怎么在线可以预览使用C#语言 如何让linkbutton点击后不刷新页面?急急急 软件登录的程序应该怎么做? 如何打印"第X页 共X页"? 关于装配件生成时碰到的一个简单而又棘手的问题 C#开发手机通信问题 救命啊, 跨线程窗口调用!
我光写个FormClosing(){}
好象没什么用
然后private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
//你要做的事
}
private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
}
上面就是Form1_Closing的格式。
{
DialogResult dr;
dr = MessageBox.Show("are you sure close the window", "Close window", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation);
if (dr == DialogResult.OK)
{
Application.Exit();
}
}