📜  c# on alt + f4 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:15.431000             🧑  作者: Mango

代码示例1
//you have to import system.windows.forms package if you aren't using a form app

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

private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
    e.Cancel = true;
}