winform dispose

触发 Form1_FormClosing,closed 

this.Close();

////循环调用所有窗口的 close ();

 Application.Exit();

//  释放 非 托管资源,但是 不能关闭窗口

  this.Dispose(false);

//释放 非 托管资源, 关闭窗口 (释放托管资源)

  this.Dispose(true);

//默认 为true  等价于  this.Dispose(true);

 (this as IDisposable).Dispose();

posted on 2012-12-07 10:08  OnCode  阅读(245)  评论(0)    收藏  举报

导航