WebToolbar.ItemWithName

From Xojo Documentation

Method

WebToolbar.ItemWithName(Name as String) As WebToolbarItem

Supported for all project types and targets.

Attempts to locate a toolbar item with the passed name. Nil will be returned if a match cannot be found.

Example

This code in the Open event handler of a toolbar adds a menu to a WebToolbarMenu button called "StatusMenu" on the toolbar:

Var tbMenu As WebToolbarMenu = WebToolbarMenu(Me.ItemWithName("StatusMenu"))
Var menu As New WebMenuItem

menu.Append(New WebMenuItem("One"))
menu.Append(New WebMenuItem("Two"))
menu.Append(New WebMenuItem("Three"))

tbmenu.Menu = menu