From e0f0a32129e30be848cb01a0a24fb3664a8d89df Mon Sep 17 00:00:00 2001 From: BlubbFish Date: Wed, 2 Jun 2010 09:08:02 +0000 Subject: [PATCH] Small fixes am icon --- NetMonitorClient/Form1.Designer.cs | 2 +- NetMonitorClient/Form1.cs | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) 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)