Important alert: (current site time 7/15/2013 9:19:36 AM EDT)
 

winzip icon

FileIcons (Updated Aug 15, 2002)

Email
Submitted on: 8/8/2002 7:22:39 PM
By: Robert Herrington 
Level: Intermediate
User Rating: By 16 Users
Compatibility: VB.NET
Views: 16280
 
     Get the associated icon of any file and store it in an ImageList. This class will fill a ListView with file names of a given path then assign the file name the icon that Windows uses as its associated icon.

 
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
//**************************************
// for :FileIcons(Updated Aug 15, 2002)
//**************************************
Feel free to use this code and redistribute it. Please give me credit and VOTE!
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

8/8/2002 10:21:18 PMbranco

there seems to be a bug with icons that appear with black areas...it seems it is the way that windows uses to make fade effect...
(If this comment was disrespectful, please report it.)

 
8/9/2002 11:08:38 AMThe New iSoftware Company!

I know there is a way to get it. I did this in vb 6!
(If this comment was disrespectful, please report it.)

 
8/15/2002 6:07:21 AM{ pHroZeN GeeK }

nice code... 5 globes from me
(If this comment was disrespectful, please report it.)

 
8/15/2002 10:19:11 PMThe New iSoftware Company!

Good update!
(If this comment was disrespectful, please report it.)

 
12/27/2002 7:05:08 AM

This code sweety perfect!
I executed this code within windows XP, and there is no Black-area that raised with other tip codes.

Thanks to code maker!
(If this comment was disrespectful, please report it.)

 
12/27/2002 7:09:24 AM

This code is sweety perfect!
I testes this code in Windows XP, and there was no 32-bit icon's black-area that appeared with other tip code.
(If this comment was disrespectful, please report it.)

 
4/16/2003 9:02:35 PMShane Manaton

Thanks, i've been looking everywhere for something like this. *****
(If this comment was disrespectful, please report it.)

 
12/2/2003 1:50:17 PMAlex C. Barberi

This works great! Too bad there's not a managed way to do this. 5 circles from me anyway.
(If this comment was disrespectful, please report it.)

 
8/20/2004 9:11:27 AM

If you set the "FlatStyle" property to "System" on the groupbox and buttons you get the XP-style. Seems nice. nice app anyway.
(If this comment was disrespectful, please report it.)

 
4/7/2005 5:43:30 AMJames H.

***** :)
(If this comment was disrespectful, please report it.)

 
5/29/2005 11:17:39 AM

Appreciated ... very helpful...
(If this comment was disrespectful, please report it.)

 
11/19/2005 12:40:36 PMEdwin

If you add an imagelist control to the form for use in, lets say, a tab control, add icons to it and run the app, you get an error. {"Index was outside the bounds of the array."} Can you help? PS Using VS 2005
Thanks
(If this comment was disrespectful, please report it.)

 
1/20/2011 4:12:03 PMpearsianMAN

very good
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.