Change Toolbar Button Icon

I have a toolbar setup like I want except depending on the window where it is being displayed - I want to change the icons of one of the buttons. The button already exists - I just want to assign a different Icon value.

The Language Reference show how to change them if you create them at the time. I have tried to reference the button with no success, the item isn’t found on compile.

In the open event of the the toolbar I tried the following statement:
tiButton.icon = newValue
me.tiButton.icon = newValue

I tried the following code in the open event of the Window:
tbNavigation.tiButton.icon = newValue

can anyone explain how to reference an existing button in a toolbar?

Put the following code into the Open event of the ToolBar.

Change the index to whichever button you require.

dim theButton as ToolItem theButton = me.item(0) ToolButton(theButton).Icon = newIconName

That works perfectly,

thanks very much