private void Form1_Resize(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Minimized)
{
notifyIcon1.Visible = true;
this.Hide();
this.ShowInTaskbar = false;
}
}
private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
{
if (this.ShowInTaskbar == false)
{
notifyIcon1.Visible = true;
this.ShowInTaskbar = true;
this.Show();
this.Activate();
this.WindowState = FormWindowState.Normal;
}
}