0

如何在 .NET 中将表单最小化到系统托盘的关闭事件

请帮忙.....

4

1 回答 1

6

将 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;
    }
}
于 2009-08-29T05:07:56.950 回答