Solved

Using Icons

Posted on 2004-09-28
5
196 Views
Last Modified: 2012-05-05
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
Comment
Question by:KarlPurkhardt
  • 4
5 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 12168341
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
 
LVL 76

Expert Comment

by:David Lee
ID: 12168348
0
 
LVL 76

Accepted Solution

by:
David Lee earned 175 total points
ID: 12168362
And another by someone different.

http://www.vb-helper.com/howto_show_file_icons.html
0
 
LVL 4

Author Comment

by:KarlPurkhardt
ID: 12168468
Thats exactly what I was looking for, thanks.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 12168518
You're welcome.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to create a duplicate finder Application 9 121
MS Date Picker 64 bit 32 bit issue 12 53
Child Form in front 4 46
Send outlook email from VBS Script 2 29
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question