Get Icon And Display

C

Chip Pearson

I would like to display the default icon for a file type in a picture
on a Windows Form (NET 3.5). For example, if I have a file name of
"C:\Book1.xls" I would like to display the default icon for Excel. I
know how to get the exe associated with the "xls" file type, so how do
I get the default icon from the exe?

I'm using VB2008 in VS2008 with NET 3.5 SP1 on Windows Vista Ultimate
SP1.

Any suggestions would be very much appreciated. Thank you very much.

Chip Pearson
www.cpearson.com
 
H

Herfried K. Wagner [MVP]

Chip Pearson said:
I would like to display the default icon for a file type in a picture
on a Windows Form (NET 3.5). For example, if I have a file name of
"C:\Book1.xls" I would like to display the default icon for Excel. I
know how to get the exe associated with the "xls" file type, so how do
I get the default icon from the exe?

Take a look at 'Icon.ExtractAssociatedIcon'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top