• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 204
  • Last Modified:

Using Icons

Hi

Im trying to add icons to my listview depending on the the file contained within it...

For example say i wanted to find the Icon for the following file

C:\SomeFile\myfile.asd

Would would be the best way to do this (using the registry is the only way i guess?) and how would I then add this icon to my listview?

I have some code for finding icons from the registry, its a little cumbersome though, and im hoping someone has a better solution, the more important thing is how can I add the icon to the listview (or an imagelist if needs be) - this should be the easy part but I just dont know how to handle the icons.

Thanks
0
KarlPurkhardt
Asked:
KarlPurkhardt
  • 4
1 Solution
 
David LeeCommented:
Here's a link to an article that describes how to retrieve the icon associated with a given file type.  

http://vbnet.mvps.org/index.html?code/icon/icon16statbar.htm
0
 
David LeeCommented:
And another by someone different.

http://www.vb-helper.com/howto_show_file_icons.html
0
 
KarlPurkhardtAuthor Commented:
Thats exactly what I was looking for, thanks.
0
 
David LeeCommented:
You're welcome.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now