下面是函数,但this.Closing += new System.EventHandler(this.Form1_FormClosing);这样写报错,load方法或者按钮的事件就可以。
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
//在窗体即将关闭之前中止线程
thread.Abort();
}
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
看到一种这样写的,通过了