Hi,
I'm using the below code to show a context menu and then some 30+ items in the subcontext menu. I've got an addhandler and the control is passed to CMenuClick when I click on the subcontext menu item but unable to capture the click event and the index(or item) of the clicked subcontext menu item.
Any help would be greatly appreciated.
I'm using the below code to show a context menu and then some 30+ items in the subcontext menu. I've got an addhandler and the control is passed to CMenuClick when I click on the subcontext menu item but unable to capture the click event and the index(or item) of the clicked subcontext menu item.
Any help would be greatly appreciated.
VB.NET:
Cpopmenu = New ContextMenu()
Cpopmenu.MenuItems.Add(New MenuItem("&Choose Columns"))
Cpopmenu.MenuItems.Add(New MenuItem("&Select All Columns"))
Cpopmenu.MenuItems.Add(New MenuItem("&Properties"))
Me.ContextMenu = Cpopmenu
For i As Integer = 0 To colcnt - 1
Cpopmenu.MenuItems.Item(0).MenuItems.Add(x.Label)
Next
AddHandler Me.Click, AddressOf CMenuClick
End Sub
Private Sub CMenuClick(ByVal sender As Object, ByVal e As System.EventArgs)
End Sub