title: NotifyIcon ContextMenu and too many click events
body: <p>I'm using the <code>NotifyIcon</code> class to display an icon in the task tray. The icon performs 2 functions - when the user single-clicks with the left button it should display a window, when the user single-clicks with the right button it should display the context menu. This works fine apart from the window being displayed after the user clicks an option in the context menu. Here's my code:</p>
  
  <pre><code>contextMenuItems = new List&lt;MenuItem&gt;();
  contextMenuItems.Add(new MenuItem("Function A", new EventHandler(a_Clicked)));
  contextMenuItems.Add(new MenuItem("-"));
  contextMenuItems.Add(new MenuItem("Function B", new EventHandler(b_Clicked)));
  trayIcon = new System.Windows.Forms.NotifyIcon();
  trayIcon.MouseClick += new MouseEventHandler(trayIcon_IconClicked);
  trayIcon.Icon = new Icon(GetType(), "Icon.ico");
  trayIcon.ContextMenu = contextMenu;
  trayIcon.Visible = true;
  </code></pre>
  
  <p>The problem is that my <code>trayIcon_IconClicked</code> event is fired when the user selects "Function A" or "Function B". Why would that be happening?</p>
  
  <p>Thanks,
  J</p>