private void Form_main_Deactivate(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Minimized)
{
this.ShowInTaskbar = false;
this.Hide();
notifyIcon.Visible = true;
}
}
private void notifyIcon_MouseDoubleClick(object sender, EventArgs e)
{
this.Show();
notifyIcon.Visible = false;
this.WindowState = FormWindowState.Normal;
this.BringToFront();
}