dynamic context menu

Joined
May 9, 2006
Messages
4
Reaction score
0
Hi I create a contextmenu from data. my code is this
Private Sub devsubmenu()
Dim cmddev As New OleDbCommand("Select modelname from devicetbl", OleDbConnection1)
OleDbConnection1.Open()
Dim dtread As OleDbDataReader = cmddev.ExecuteReader()
devmnu.MenuItems.Clear()
Do While dtread.Read
devmnu.MenuItems.Add(dtread.Item("modelname").ToString())
Loop
OleDBConnection.Close()
End Sub
The menu created is fine.
Now when i click one of the menu items created with the code above i want to take the "text" of the menu item and store it to a variable.
Here is my problem, how can i handle a click event from these items?
smiley_confused.gif

Any Ideas???
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top