This article applies to VB.NET development on Microsoft .NET, tested on .NET framework 3.5.
Add submenu to System.Windows.Forms.ContextMenu.
Add the following codes to a form.
Add submenu to System.Windows.Forms.ContextMenu.
Add the following codes to a form.
Dim listMenu As ContextMenu
listMenu = New ContextMenu
Dim mi As New MenuItem("Group 1")
mi.MenuItems.Add("Sub 1")
mi.MenuItems.Add("Sub 2")
listMenu.MenuItems.Add(mi)
Comments