Close form to system tray
April 11, 2009
Feedback's a good way to encourage author even if it's a criticize. It's proved you care about the article. Please, leave a comment to let everyone know what you think about this post.
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