简而言之,我有这个:
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = true;
this.WindowState = FormWindowState.Minimized;
this.ShowInTaskbar = false;
}
而且它不起作用(按下“X”时程序关闭,而不是我的目的地 - 最小化它);可能是什么问题呢?
this.ShowInTaskbar = false; // is used because app goes to system tray and it doesn't need to be showed in taskbar.