title: Notify Icon stays in System Tray on Application Close
body: <p>I have an application which runs only from the System Tray, it's only purpose is to provide the user with information via Ballon Tips.</p>
  
  <p>It's running well, apart from one minor annoyance. When the application is closed using the Task Manager (as opposed to using the context menu) the icon sticks around in the system tray, until you hover over it, then when another instance is opened you get a second icon sitting beside the first.</p>
  
  <p>My Form Closed event looks like this, it does nothing:</p>
  
  <pre><code>private void frmMain_FormClosed(object sender, FormClosedEventArgs e)
  {
      ntfyIcon.Visible = false;
      ntfyIcon.Icon = null;
      ntfyIcon.Visible = false;
      ntfyIcon.Dispose();
  }
  </code></pre>
  
  <p>This <a href="http://connect.microsoft.com/VisualStudio/feedback/details/98317/notify-icon-doesnt-go-away-when-your-program-closes" rel="noreferrer">has been reported on Microsoft Connect</a> and has been closed by Microsoft under <code>Won't Fix</code> as, apparently, this is what is supposed to happen but I was hoping that somebody had a solution.</p>
  
  <p>I was thinking something along the lines of cleaning the system tray on application open?</p>
  
  <p>Thanks</p>