Solved

Using Icons

Posted on 2004-09-28
5
198 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

749 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