I’m trying to build a hierarchical contextual menu from code, but I don’t know in advance the hierarchy depth, so I would like to add submenu items on demand when the user selects a menuitem with children menuitems to avoid the potential long wait that traversing the tree would take.
Is there a way to do that?
Case “C”
Dim c1 As New MenuItem(“C 1”)
AddHandler c1.EnableMenu, AddressOf Menu_EnableMenu
item.Append(c1)
item.Append(New MenuItem(“C 2”))
item.Append(New MenuItem(“C 3”))
Case “C 1”
For i As Integer = 0 To 10
item.Append(New MenuItem("C 1 " + Str(i)))
Next