diff --git a/NetMonitorClient/Form1.Designer.cs b/NetMonitorClient/Form1.Designer.cs index 74c6147..f2cc39c 100644 --- a/NetMonitorClient/Form1.Designer.cs +++ b/NetMonitorClient/Form1.Designer.cs @@ -176,7 +176,7 @@ this.Controls.Add(this.menuStrip1); this.MainMenuStrip = this.menuStrip1; this.Name = "Netzmonitor"; - this.ShowInTaskbar = false; + this.Resize += new System.EventHandler(Netzmonitor_Resize); this.Text = "Netzmonitor"; this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); diff --git a/NetMonitorClient/Form1.cs b/NetMonitorClient/Form1.cs index d5d8ccd..d352409 100644 --- a/NetMonitorClient/Form1.cs +++ b/NetMonitorClient/Form1.cs @@ -6,6 +6,7 @@ using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; +using System.Collections; namespace NetMonitorClient { @@ -19,9 +20,19 @@ namespace NetMonitorClient this.sc = new ServiceControl("NetMonitorServer"); } + private void Netzmonitor_Resize(object sender, System.EventArgs e) + { + if (this.WindowState == FormWindowState.Minimized) + { + this.ShowInTaskbar = false; + this.WindowState = FormWindowState.Minimized; + } + } + private void trayIcon_MouseDoubleClick(object sender, MouseEventArgs e) { - this.WindowState = System.Windows.Forms.FormWindowState.Normal; + this.WindowState = FormWindowState.Normal; + this.ShowInTaskbar = true; } private void TrayMenuNet_Click(object sender, EventArgs e)