How can I change the ToolBar.ToolButton.Icon at Opening time?

I just spent two hours looking for a way to do it without finding anything.

The closest thing I can come to is putting some code in ToolBar11.Opening.

So, I tried several keywords, without finding anything.

I went to the documentation (Opening).
I added the Event, and as code, I wrote:

Toolbar11.ToolItem_About. (see screenshot)

It doesn’t seem possible to change the icon.

Am I right or wrong? If the latter, any guidance on how to do it would be appreciated.

Desktop Application
Binary Project
Xojo 2024r4.1 (preliminary customer presentation coming soon)
Sequoia 15.3.2
MacBook Pro 13" m1

Thanks

You need to cast the DesktopToolbarItem to a DesktopToolbarButton to access the Icon property.

var oButton as DesktopToolbarButton = DesktopToolbarButton(Toolbar11.ToolItem_About)
oButton.Icon = picAbout
1 Like

Have you seen the Dynamic Desktop Toolbars example?
That may give you an idea:

1 Like

Thank you Tim and Alberto.

@Tim: will try right away, then have a dinner…(or in the other order: my stomac is crying :wink: )

@AlbertoD : Before starting with the ToolBar, I’ve made a search on my hard disk for the examples, and I found… plethora (iOS, Android, Web, Desktop) all presenting the same icons, probable the same example; icons files are suffixed -3x, -6x… some have -4x and -8x
Black and white icons, not appealing. The first project I opened was for smartphone (forgot which one, but the window was explicit, so I go away from the examples.