Add DropDownButton to Existing ToolButton

Hi

I don’t understand how to add an DropDownButton menu to an existing ToolButton. The two examples:

http://documentation.xojo.com/index.php/ToolButton

are working. But both adding a new button to the Toolbar. I would like to use an existing ToolButton. But I don’t see how I can access a single ToolButton in my Toolbar to add the menu.

You have to cast the toolbar Item() into a ToolButton.

ToolButton(toolbar1.Item(x)).DropDownMenu = myMenu

Ah. Worked like a charm. Thank you very much!