I can perform the submenu list down using the codes below:
Dim cm As GoContextMenu = New GoContextMenu(view) 'GoContextMenu Inherits System.Windows.Forms.ContextMenu
Dim subTop(1) As MenuItem ' if you have 2 submenu, then the array count is 2-1 = 1; subm(1)
Dim orMenu As New MenuItem("OR", New EventHandler(AddressOf Me.OrTopGateItem_Click))
Dim andMenu As New MenuItem("AND", New EventHandler(AddressOf Me.AndTopGateItem_Click))
cm.MenuItems.Add(New MenuItem("Type", subTop))
From the case above, I manage to create a submenu which is shown in the image below: screen shot of my submenu outcome
How can I dynamically add more submenu during run time?
Thank you.