ToolbarButton.Icon
From Xojo Documentation
Property (As Picture )
aToolbarButton.Icon = newPictureValue
or
PictureValue = aToolbarButton.Icon
New in 2019r2
Supported for all project types and targets.
or
PictureValue = aToolbarButton.Icon
New in 2019r2
Supported for all project types and targets.
The picture to be displayed by the ToolbarButton.
Example
This example adds icons to the Cities menu and each MenuItem in the Initialized event of the Toolbar.
DropDownButton = New ToolButton
DropDownButton.ButtonStyle = ToolbarButton.ButtonStyles.DropDown
DropDownButton.Caption = "Cities"
// create a menu
Var myMenu As New MenuItem
Var myMenuItem1 As New MenuItem
Var myMenuItem2 As New MenuItem
Var 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.Add(myMenuItem1)
myMenu.Add(myMenuItem2)
myMenu.Add(myMenuItem3)
// assign the new menu to the toolitem..
DropDownButton.Menu = myMenu
// add to the toolbar
Me.Add(DropDownButton)
DropDownButton.ButtonStyle = ToolbarButton.ButtonStyles.DropDown
DropDownButton.Caption = "Cities"
// create a menu
Var myMenu As New MenuItem
Var myMenuItem1 As New MenuItem
Var myMenuItem2 As New MenuItem
Var 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.Add(myMenuItem1)
myMenu.Add(myMenuItem2)
myMenu.Add(myMenuItem3)
// assign the new menu to the toolitem..
DropDownButton.Menu = myMenu
// add to the toolbar
Me.Add(DropDownButton)