From Xojo Documentation


WebMenuItem.Append(Item As WebMenuItem)

New in 2011r2

Supported for all project types and targets.

Appends the item to the end of the menu.


This example populates a contextual menu.

Var menu As New WebMenuItem

menu.Append(New WebMenuItem("One"))
menu.Append(New WebMenuItem("Two"))
menu.Append(New WebMenuItem("Three"))
Me.ContextualMenu = menu

This example populates two menus that are attached to a buttons on WebToolbars. The line that follows the last call to append attaches the menu to the correct button.

// Create the chart menu
Var chartMenu As New WebMenuItem
chartMenu.Append(New WebMenuItem("Line"))
chartMenu.Append(New WebMenuItem("Bar"))
chartMenu.Append(New WebMenuItem("Pie"))
chartMenu.Append(New WebMenuItem("-"))
chartMenu.Append(New WebMenuItem("3D Line"))
chartMenu.Append(New WebMenuItem("3D Bar"))
chartMenu.Append(New WebMenuItem("3D Pie"))
WebToolBarMenu(Me.ItemWithName("ChartsButton")).Menu = chartMenu // Attach menu to ChartsButton

// Create the Dates menu
Var dateMenu As New WebMenuItem
dateMenu.Append(New WebMenuItem("Today"))
dateMenu.Append(New WebMenuItem("Tomorrow"))
dateMenu.Append(New WebMenuItem("Next Week"))
dateMenu.Append(New WebMenuItem("Next Month"))
WebToolBarMenu(Me.ItemWithName("DatesButton")).Menu = dateMenu // Attach menu to DatesButton