473,425 Members | 1,807 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,425 software developers and data experts.

How to find icons to use with Treeview Control

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
8 12104
FishVal
2,653 Expert 2GB
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
8,834 Expert 8TB
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
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
8,834 Expert 8TB
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
8,834 Expert 8TB
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
2,322 Expert Mod 2GB
If anyone has copies of those files, I would very very very much like a copy.
Jan 21 '11 #7
ADezii
8,834 Expert 8TB
Here you go, TheSmileyOne:
Attached Files
File Type: zip CMCTL198.zip (248.9 KB, 1733 views)
Jan 21 '11 #8
TheSmileyCoder
2,322 Expert Mod 2GB
Thank you!
Jan 21 '11 #9

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

Similar topics

0
by: Garet Cammer | last post by:
I am writing a VB 6.0 program similar to Windows Explorer, which has a tree view and a list view to select directories and files. I would like to associate an icon with each file, according to the...
4
by: What-a-Tool | last post by:
Is possible to use the windows image list for icon display in my treeview control? Would appreciate it you could point me towards a code sample or Key phrase to use in a google search. Thanks...
3
by: Keith Elder | last post by:
I am using VS 2005 Beta and I have a Treeview UserControl that I built for a menu. I added an imageList to the control and added some icons that I want to associate with the control. When I build...
3
by: lwhitb1 | last post by:
I created my own icons, and I would like to be able to use them instead of all the default icons they provide. Is this possible? -- lee
2
by: OpticTygre | last post by:
Hi folks. I'm currently in the midst of building an explorer - like viewer for a bigger project I'm going to be working on soon. When building the class for my Treeview and Listview controls, I'm...
0
by: Roguespider | last post by:
I'm new to posting but have been using past help so I come seeking some. I'm using VB.NET 2002 writing a form that contains both a TreeView and a ListView. I'm using the commonly mentioned...
0
by: jiing | last post by:
Hi all, I want to use sting(the same as Node.Text) to judge if a node exists in TreeView. I've tried several ways, but seems all failed. could anybody help me? Thanks in advance. //My...
1
by: vegas26 | last post by:
hi i have a strange behaviour in my treeview control. it shows no more my icons after i did translate my winform into other languages (localized). it still shows the placeholders for the...
3
by: Jeff | last post by:
Hey ..NET 2.0 I'm trying to search a TreeView control for a specific TreeNode The code below doesn't work because it only searches the the top level of the nodes. I would like to program it...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.