Windows Icons

M

Mike

Hi,

I am developing a document management system in MS Access (adp on top
of SQL Server). One thing I would like to do in my listview is show the

default icon associated in Windows with that specific file extension
(e.g. show the excel icon when my file has an xls-extension as Windows
Explorer does).


I found some neat VB-code to extract the default icon from the Windows
Registry (http://www.developerfusion.co.uk/show/2982/) and assign it to

a PictureBox. So, this basically does what I want, except for the fact
that I cannot do this in VBA since it uses a PictureBox's hDC. VBA does

not have a PictureBox and the closest control being an ImageControl has

no hDC.


Did anybody ever try to do the same or know how to tackle this?


Thanks,


Mike
 
P

Perry

Are you trying to assign icons to listitems in a listview?
are you trying to assign icons to a PictureBox?
are you trying to assign icons hosted in your listview to other controls?

If the latter, you could use something like:

With Me.ListView1
Me.CommandButton1.Picture =
..Icons.ListImages(.SelectedItem.Icon).Picture
End With

Krgrds,
Perry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top