Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 .NET 中将表单最小化到系统托盘的关闭事件
请帮忙.....
将 NotifyIcon 控件添加到表单和 FormClosing 的事件处理程序:
private void Form1_FormClosing(Object sender, FormClosingEventArgs e) { if (e.CloseReason == CloseReason.UserClosing) { e.Cancel = true; this.Visible = false; this.notifyIcon1.Visible = true; } }