title: C# assign click action for dynamic menuStrip items
body: <p>I'm building a program that relies on reading the SerialPorts available on a system and populating a menuStrip item.  I've been able to populate the menuStrip submenu but I am stuck on how to add a click event to the dynamically filled in list.  My code is below:       </p>
  
  <pre><code>    public void getPorts()
      {
          int count = 0;
          string[] ports = SerialPort.GetPortNames();
          foreach(string port in ports)
          {
              //MessageBox.Show("Serial Port " + port + " found!");
              ToolStripItem subItem = new ToolStripMenuItem(port);
              portMenuItem.DropDownItems.Add(port);
              count += 1;
          }
      }
  </code></pre>
  
  <p>I feel like something needs to go into the <code>foreach</code> loop but I have been unable to locate it.  Any help would be awesome!</p>