In my windows forms application (C#) I have such code:
private void frm_main_Resize(object sender, EventArgs e)
{
if ((this.WindowState == FormWindowState.Minimized) && (checkBox1.Checked))
{
this.ShowInTaskbar = false;
notifyIcon1.Visible = true;
}
}
private void notifyIcon1_DoubleClick(object Sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Minimized)
{
this.WindowState = FormWindowState.Normal;
}
else
{
this.WindowState = FormWindowState.Minimized;
}
this.Activate();
}
My publick form has Double click handler notifyIcon1.DoubleClick += new System.EventHandler(this.notifyIcon1_DoubleClick);
When minimized app still apears in taskbar, how to change that? I want that on minimized state it only would be in system tray. Why does this coce deosnt work?