title: Check if a drop down list already contains a dynamically added item
body: <p>I'm adding existing COM ports that are available on the system to a drop down list. So far I've got this:</p>
  
  <pre><code>private void Form1_Load(object sender, EventArgs e)
  { 
      foreach (string port in System.IO.Ports.SerialPort.GetPortNames())
      {
          ToolStripMenuItem t = new ToolStripMenuItem();
          t.Text = port;
          t.Checked = port == notifier.COMPort;
          t.Click += t_Click;
          setPortToolStripMenuItem.DropDownItems.Add(t);
      }
  }
  </code></pre>
  
  <p>This works when adding the ports initially, however I want to check again for COM ports that have been added or removed before the user clicks on my drop down box to display the ports.</p>
  
  <p>I see I can use <code>setPortToolStripMenuItem.DropDOwnItems.ContainsKey()</code> but I have no idea what keys it uses when I add them.</p>
  
  <p>This does not work:</p>
  
  <pre><code>private void setPortToolStripMenuItem_DropDownOpening(object sender, EventArgs e)
  {
      string[] ports = System.IO.Ports.SerialPort.GetPortNames();
  
      foreach (string s in ports)
      {
          if (!setPortToolStripMenuItem.DropDownItems.ContainsKey(s))
          {
              ToolStripMenuItem t = new ToolStripMenuItem();
              t.Text = s;
              t.Checked = s == notifier.COMPort;
              t.Click += t_Click;
              setPortToolStripMenuItem.DropDownItems.Add(t);
          }
      }
  }
  </code></pre>
  
  <p>Can I specify what key it uses when I add the item or is there another way of checking existing items?</p>