//窗体关闭之前
this.FormClosing += (s, r) =>
{
    System.Environment.Exit(0);
};
//窗体关闭
this.Closed += (s, r) =>
{
    this.Dispose();
    this.Close();
};

 

相关文章: