context menu question

  • Thread starter Thread starter Starbuck
  • Start date Start date
S

Starbuck

Hi

I have a contextm enu on a form and called it - jobMenu and this is linked
to a datagrid
When the right mouse button is clicked the following code is called and the
menu displayed.

private void jobMenu_Popup(object sender, System.EventArgs e)

{

MenuItem menuItem1 = new MenuItem("Edit");

MenuItem menuItem2 = new MenuItem("Delete");

// Clear all previously added MenuItems.

jobMenu.MenuItems.Clear();

jobMenu.MenuItems.Add(menuItem1);

jobMenu.MenuItems.Add(menuItem2);

}



I cannot figure out what I do next, how do I call procedures when clicking
on the popup menu options,



Thanks in advance
 
You need to set up event handlers for each menu item. If you use VS.NET this
is very simple, just double click on the menu item in the designer.

Thomas P. Skinner [MVP]
 
Back
Top