Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding SubContextMenu items at runtime 1

Status
Not open for further replies.

bigtimmin

MIS
Apr 12, 2005
125
US
Here is an example of the code I am using to dynamically add items to the context menu.
Code:
Me.ContextMenu.MenuItems.Add("Test")
Me.ContextMenu.MenuItems.Add("Item1", New EventHandler(AddressOf HandleItem1))
How would I make Item1 a subitem of Test?
 
Like this....
Code:
Dim oItem As New MenuItem("Test")
Dim subItem1 As New MenuItem("Item1")
Dim subItem2 As New MenuItem("Item2")
oItem.MenuItems.Add(subItem1)
oItem.MenuItems.Add(subItem2)
Me.ContextMenu1.MenuItems.Add(oItem)


Sweep
...if it works dont mess with it
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top