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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Images to a Listbox control Excel VBA

Status
Not open for further replies.

JasonEnsor

Programmer
Sep 14, 2010
193
GB
Hey Guy's

I am looking at creating a userform in excel that holds a listbox to show file names and to also show coloured dots next to each file in the directory depending on if they are currently open or not. I will determine if they are open by using custom properties. I automate excel update the view every couple of minutes to reflect changes in which documents are open or closed.

I can create a userform, I can create custom properties. What I am unsure of is how to attach images to a listbox control.

Any thoughts or pointers would be appreciated

J.
 
>What I am unsure of is how to attach images to a listbox control

That's because the userform Listbox control does not support images. It is possible to get around this by creating what is known as an ownerdraw listbox - but this requires a fairly substantial understanding of subclassing, callbacks, and the Windows API.

Perhaps you might try considering a ListView control in List view, with SmallIcon set appropriately
 
Hi Strongm,

Thanks for the suggestion, I shall give it a try and see how it goes.

Many Thanks

J.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top