[zz]winform 窗体关闭事件

注册窗体关闭事件:

在Form1.Designer.cs 文件中添加:

 this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);

然后在form1中添加方法:

private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            some code;
        }

posted @ 2017-06-16 16:18  Raywang80s  阅读(468)  评论(0编辑  收藏  举报