By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,841 Members | 1,736 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,841 IT Pros & Developers. It's quick & easy.

How to find icons to use with Treeview Control

P: 69
Hello. I'm using a treeview control on my Access 2007 form. The treeview will be used to show the directory structure of a given file path. I've been able to successfully populate the nodes on the treeview. What I don't know how to do is locate the appropriate icons to place next to the nodes. Or, put another way, how to I query local computer's OS to find out which icon goes with each file?

For example, I want to display folder icon next to directories, a Microsoft Access icon next to Access files, and an Excel icon next to Excel files ... just like Windows Explorer does.

I don't need the complete code (although that would be nice), just a point in the right direction. An API call maybe?

I've researched previous posts at this site and looked at the Howtos, but I didn't see anything that demostrated how to find the icons (just load up the nodes, which I can already do).

Also, can anyone send me the help files for the Windows Common Controls? They're supposed to come with Windows XP (like the controls do) but I don't have them. I guess this is a common problem. The files are:
cmctl198.chm
cmctl198.chi



Thanks,
sphinney
Sep 25 '08 #1
Share this Question
Share on Google+
8 Replies


FishVal
Expert 2.5K+
P: 2,653
Hello, sphinney.

A brief googling gives:
http://www.vb-helper.com/howto_get_file_type_icons.html
http://binaryworld.net/Main/CodeDetail.aspx?CodeId=923

Quite enough to start from.

Regards,
Fish
Sep 25 '08 #2

ADezii
Expert 5K+
P: 8,669
The easiest and most efficient means to utilize Icons with the TreeView Control is to:
  1. Load all your Icons into an ImageList Control.
  2. Set the ImageList Property of the TreeView Control to the Name of the ImageList Control.
  3. Specify the appropriate Icons as Index Numbers into the Images contained in the ImageList Control as the 5th (Image) and/or 6th (Selected Image) Arguments to the Add Method of the Node Object.
Sep 25 '08 #3

P: 69
The easiest and most efficient means to utilize Icons with the TreeView Control is to:
  1. Load all your Icons into an ImageList Control.
  2. Set the ImageList Property of the TreeView Control to the Name of the ImageList Control.
  3. Specify the appropriate Icons as Index Numbers into the Images contained in the ImageList Control as the 5th (Image) and/or 6th (Selected Image) Arguments to the Add Method of the Node Object.
Thanks, ADezii. Any idea's on how to get the help file for the Windows Common Controls? The help file covers both the Treeview and the Imagelist controls. The files I need are: cmctl198.chm and cmctl198.chi. I can't seem to find them anywhere on the web. Googling on the filename will give me lots of hits. But all the sites with the files don't seem to come up. Microsoft just says the help files come with FoxPro (I only have plain old Access).

FishVal - Thanks for the links. I wan't even sure what text to use for a google search.

Thanks,
sphinney
Sep 25 '08 #4

ADezii
Expert 5K+
P: 8,669
Thanks, ADezii. Any idea's on how to get the help file for the Windows Common Controls? The help file covers both the Treeview and the Imagelist controls. The files I need are: cmctl198.chm and cmctl198.chi. I can't seem to find them anywhere on the web. Googling on the filename will give me lots of hits. But all the sites with the files don't seem to come up. Microsoft just says the help files come with FoxPro (I only have plain old Access).

FishVal - Thanks for the links. I wan't even sure what text to use for a google search.

Thanks,
sphinney
Not sure, but I will look into it.
Sep 25 '08 #5

ADezii
Expert 5K+
P: 8,669
Thanks, ADezii. Any idea's on how to get the help file for the Windows Common Controls? The help file covers both the Treeview and the Imagelist controls. The files I need are: cmctl198.chm and cmctl198.chi. I can't seem to find them anywhere on the web. Googling on the filename will give me lots of hits. But all the sites with the files don't seem to come up. Microsoft just says the help files come with FoxPro (I only have plain old Access).

FishVal - Thanks for the links. I wan't even sure what text to use for a google search.

Thanks,
sphinney
spinney, here is an early Christmas Gift!
Sep 25 '08 #6

TheSmileyCoder
Expert Mod 100+
P: 2,321
If anyone has copies of those files, I would very very very much like a copy.
Jan 21 '11 #7

ADezii
Expert 5K+
P: 8,669
Here you go, TheSmileyOne:
Attached Files
File Type: zip CMCTL198.zip (248.9 KB, 1624 views)
Jan 21 '11 #8

TheSmileyCoder
Expert Mod 100+
P: 2,321
Thank you!
Jan 21 '11 #9

Post your reply

Sign in to post your reply or Sign up for a free account.