Domanda

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();
}
È stato utile?

Soluzione

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top