Solved

Using Icons

Posted on 2004-09-28
5
200 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: 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!

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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…

726 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