views:

68

answers:

1

How to minimize a Form to System Tray on Closing Event in .NET

Please HELP.....

+6  A: 

Add a NotifyIcon control to the form and an event handler for FormClosing:

private void Form1_FormClosing(Object sender, FormClosingEventArgs e)
{
    if (e.CloseReason == CloseReason.UserClosing)
    {
        e.Cancel = true;
        this.Visible = false;
        this.notifyIcon1.Visible = true;
    }
}
jgottula