ToolButton.Icon

From Xojo Documentation

Property (As Picture )
aToolButton.Icon = newPictureValue
or
PictureValue = aToolButton.Icon

Supported for all project types and targets.

The picture to be displayed by the ToolButton.

Example

This example adds icons to the Cities menu and each MenuItem in the Open event of the Toolbar.

DropDownButton = New ToolButton
DropDownButton.Style = ToolButton.ToolStyleDropDown
DropDownButton.Caption = "Cities"

// create a menu
Dim myMenu As New MenuItem
Dim myMenuItem1 As New MenuItem
Dim myMenuItem2 As New MenuItem
Dim myMenuitem3 As New MenuItem

DropDownButton.Name = "Cities Menu"
myMenu.Text = "Cities"
myMenu.Icon = IndiaImage

myMenuItem1.Text = "Grand Blanc"
myMenuItem2.Text = "Bad Axe"
myMenuitem3.Text = "Flint"
// icons added to the project
myMenuItem1.Icon = SaturnImage
myMenuItem2.icon = VenusImage
myMenuItem3.icon = UranusImage
myMenu.Append(myMenuItem1)
myMenu.Append(myMenuItem2)
myMenu.Append(myMenuItem3)

// assign the new menu to the toolitem..
DropDownButton.DropdownMenu = myMenu

// add to the toolbar
Me.Append(DropDownButton)