日期:2014-05-18 浏览次数:20775 次
#region 托盘程序 private void Main_FormClosing(object sender, FormClosingEventArgs e) { this.Visible = false; nIcon.Visible = true; e.Cancel = true; } private void nIcon_DoubleClick(object sender, EventArgs e) { this.Visible = true; nIcon.Visible = false; } #endregion
private void tMenu05_0_Click(object sender, EventArgs e) { Application.Exit(); }
this.Visible = false; nIcon.Visible = true;
bool exit = false; private void Main_FormClosing(object sender, FormClosingEventArgs e) { if (!exit) { this.Visible = false; nIcon.Visible = true; e.Cancel = true; } } private void nIcon_DoubleClick(object sender, EventArgs e) { this.Visible = true; nIcon.Visible = false; } private void tMenu05_0_Click(object sender, EventArgs e) { exit = true; this.Close(); }
------解决方案--------------------
在Closing里面有CloseReason来判断~~~~`
------解决方案--------------------
Closing