Hi, My application has a Menu that has been dynamically created from files in a specific directory. I'm trying to edit the code so that if I click on one of those dynamically created Menu Items, I want it to MsgBox the item I clicked.
Here is what I have so far:
The above code will msgbox the 2nd item of the dynamically created menu when I click on any item in the menu. Does anyone know how to make it msgbox the item clicked?
Thanks!
Here is what I have so far:
Code:
For Each file In files
If file <> "" Then
AddHandler LanguageToolStripMenuItem.DropDown.Click, AddressOf fileMenuItem_click
End If
Next
Public Sub fileMenuItem_click(ByVal sender As System.Object, ByVal e As System.EventArgs)
MsgBox(LanguageToolStripMenuItem.DropDownItems.Item(1).Text)
End Sub
The above code will msgbox the 2nd item of the dynamically created menu when I click on any item in the menu. Does anyone know how to make it msgbox the item clicked?
Thanks!