O'Reilly logo

Visual Basic® .NET by Example by Bob Donald, Gabriel Oancea

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required