Hi add a mainmenu to a form, add one item to the mainmenu then
copy paste the following code in the form load event and copy paste the
Private Sub MenuItem_Click somewhere outside the form load event, and test
the app.
Dim x As MenuItem
For i As Integer = 0 To 9
x = New MenuItem
x.Text = CStr(i)
AddHandler x.Click, AddressOf MenuItem_Click
MainMenu1.MenuItems(0).MenuItems.Add(x)
Next
Private Sub MenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
MsgBox(DirectCast(sender, MenuItem).Text)
End Sub
hth Greetz Peter
--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.
"Mac via DotNetMonster.com" <fo***@nospam.DotNetMonster.com> schreef in
bericht news:23******************************@DotNetMonste r.com...
Hi all,
I have a menu that is populated from the results of an SQL query. For
example lets say the menu contains a list of clients IDs. I would like to
click on a particular item and open up a form passing in the particular
client ID that I have clicked on.
It is possible to have a generic event that is activated for any item that
is selected in the menu?
regards,
Mac
--
Message posted via http://www.dotnetmonster.com