0

I've coded my form to take name values from a table in MySQL and add them as sub menu items. Now I would like for my code to load information from another table corresponding to the menu item that was created. How can i do that?

Here is my working code. All it's missing is the "On click" event.

Cheers and thanks.

private void populateMenuItem()
{
    Query = "select * from serpesa.proveedores;";
    mysqlConnect();

    while (mysqlReader.Read())
    {
        string menuItem = mysqlReader.GetString("nombre");
        abrirToolStripMenuItem.DropDownItems.Add(menuItem);
    }
    mysqlDisconnect();
}
Adi Inbar
  • 12,097
  • 13
  • 56
  • 69
0xdesdenova
  • 192
  • 1
  • 8

1 Answers1

1

Add() returns the ToolStripItem that it creates.
You can then add a handler to its Click event.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964