문제

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();
}
도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top