Accessing buttons on Toolbars

I need to access buttons on toolbars at runtime to set the Pushed property. I don’t understand why you can’t use the same syntax you would use to enable or disable a button i.e. I can write:

ToolBar.Item(6).Enabled = False

So what I want to do is

 ToolBar.Item(6).Pushed = True

Why are the properties of the button not available when accessing the item by index? and how do I overcome this?

That is why there are 3rd party toolbars…

I’ve found that this works for me to update the Pushed property:

ToolButton(Toolbar1.Item(2)).Pushed=true

Toolbar1 is your instance of a toolbar. ToolButton just typecasts the item as a Toolbutton so you can set the pushed property.

[quote=78889:@Tom Iwaniec]I’ve found that this works for me to update the Pushed property:

ToolButton(Toolbar1.Item(2)).Pushed=true

Toolbar1 is your instance of a toolbar. ToolButton just typecasts the item as a Toolbutton so you can set the pushed property.[/quote]

Perfect. This is exactly what I needed. Thanks very much.