在关闭窗体时发生。Closing 事件;
关闭窗体后发生。 Closed 事件;
关闭窗体后发生。 Closed 事件;
解决方案 »
- vs2010下如何使【“System.Data.OracleClient.OracleConnection”已过时】等警告信息不显示?
- 用什么方法可以实时的把基类转换成子类
- 刚装好vs2005,但每次启动老是要哦选择默认开发环境?
- 求winform 里word转pdf源代码
- 关于 secur32.dll的引入
- 自已空闲写的一款书签,小巧实用,可以将网站分类整理 !
- 一个有关static修饰的同步疑问,请高手解答,马上给分
- 类型转换难题,怎样根据控件类型名称转换到对应的控件
- C#调用WinHttp.WinHttpRequest.5.1 Get网页 乱码问题
- 数据库中数值型数据如何取出
- C#如何实现不定参数个数的函数
- 怎么在C#中copy目录,没有现成的方法呢??
{
if( !CreateMyForm( "请问是否要保存?" )
//保存CODE
else
//不保存CODE
}bool CreateMyForm(string formTitle){
bool result = false;
System.Windows.Forms.Form form1 = new System.Windows.Forms.Form();
form1.Text = formTitle;
form1.MaximizeBox = false;
form1.MinimizeBox = false;
form1.AutoScale = false;
form1.ClientSize = new System.Drawing.Size(190, 50);
System.Windows.Forms.Button button1 = new System.Windows.Forms.Button();
button1.Cursor = System.Windows.Forms.Cursors.Hand;
System.Windows.Forms.Button button2 = new System.Windows.Forms.Button();
button2.Cursor = System.Windows.Forms.Cursors.Hand;
button1.Text = "保存";
button1.Location = new System.Drawing.Point (10, 10);
button2.Text = "不保存";
button2.Location
= new System.Drawing.Point( button1.Right+10,10 );
button1.DialogResult = DialogResult.OK; button2.DialogResult = DialogResult.Cancel; form1.FormBorderStyle = FormBorderStyle.FixedDialog;
form1.AcceptButton = button1;//
form1.CancelButton = button2;
form1.StartPosition = FormStartPosition.CenterScreen;
form1.Controls.Add(button1);
form1.Controls.Add(button2);
form1.ShowDialog();
if(form1.DialogResult == DialogResult.OK){
result = true;
this.Cursor = System.Windows.Forms.Cursors.AppStarting;
}else{
result = false;
this.Cursor = System.Windows.Forms.Cursors.AppStarting;
}
form1.Dispose();
return result;
}
this.Closing += new System.ComponentModel.CancelEventHandler(this.Form_Closing);
的意思吗
一般是放在什么地方。我对委托一窍不通。