handling events for context menu items
Posted on 2010-11-16
I add menu items to my context menu strip, and then add a hanler for the click event. In the subroutine, how can I tell which menu item was clicked?
I'm familiar with the static context menu strip where I can use "sender.tostring", but I don't think that will work for my runtime context menu strip.
In the form_load subroutine:
For each cgems in listArray
Dim Y As New ToolStripMenuItem
Y.Text = cgems
Y.CheckOnClick = True
Y.DisplayStyle = ToolStripItemDisplayStyle.Text
AddHandler Y.Click, AddressOf Me.clickCGEMS