Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change a Toolbar Button Image from Imagelist 1

Status
Not open for further replies.

mikemcginty

Programmer
Jul 11, 2002
184
AU
Can anyone tell me how to change a button image for a toolbar at runtime.

The Toolbar has an associated imagelist and I want to change the image from time to time. The following code gives a runtime error 424 Object Required

Set tbToolBar.Buttons(5).Image = imlToolbarIcons.ListImages(21).Picture

Thanks

Mike

When you call out for help in the darkness, and you hear a voice in return, you're probably just talking to yourself again!
 
Simply do this.

[tt]tbToolBar.Buttons(5).Image = 21[/tt]

The Image property of the Button object in a toolbar simply accepts the Index or Key of the list image from the ImageList control (not a picture object).
 
Thanks Hypetia

That saved me a lot of time and frustration

Mike

When you call out for help in the darkness, and you hear a voice in return, you're probably just talking to yourself again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top