Nested Menus
Menus can, of course, be nested. A menu can have a submenu and items. The submenu can also have a submenu, items, and so on. Nested menus are quite simple to create in VB .NET using the Framework classes. Each MenuItem object can contain a list of child MenuItem objects. This list is represented by the MenuItems property on the MenuItem class. MenuItems is a collection of MenuItem objects.
If the MenuItems property contains zero MenuItems this means the MenuItem does not have a submenu and is considered to be a leaf menu. If you think of a tree as an analogy, a tree has branches and each branch extends outward to form more branches. Each branch ends with a leaf. A leaf MenuItem is considered the last MenuItem extending from the main ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access