Close form to system tray
April 11, 2009
Don't know what to read next? Check out the list of popular posts. People like them, they should be good.
Instead of close down the app, the app hide in the system tray instead.
Will require a NotifyIcon and a ContextToolStrip
public bool ExitTime = false;
private void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
{
if (!ExitTime)
{
e.Cancel = true;
this.Hide();
}
}
private void ntIcon_DoubleClick(object sender, EventArgs e)
{
this.Show();
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
ExitTime = true;
Application.Exit();
}

Isn’t that like all the content worth crawling? ,
Trackbacks