TreeView Icons

gray

Registered User.
Local time
Today, 03:19
Joined
Mar 19, 2007
Messages
578
Hi All

Access 2007
WinXPPro SP3

I have a treeview control which I'd like to pretty up with icons. I've added an ImageList Control, added .bmp icons into the project's folder, imported the icons into the imaglelist and initialised the imagelist by adding it to the TrreCtrl Properties. The images are set 16x16.

I've used both index number and image name in my add nodes call e.g. :-

Tv.Nodes.Add Host_Node_Key, tvwChild, New_Node_Key, New_Node_Name, "Customers_icon", 2

but the stubborn beast refuses to display the icons. When I change the image name to , say "xxx_icon" Access rightly complains that it does not exist... so I can't be too far off.

Any ideas why my icons don't display please?
 
If you post the db I'll take a look. I just set up a treeview, imagelist with a .bmp, and displayed it in the root node, so it's possible.
Cheers,
 
Hi

The attached is the sample I'm teaching myself Treeview from. If you search the VB module for "nodes.add" you'll see where I'm adding indexes from the imagelist control...

I had a horrible feeling that the problem was some obscure needle-in-a-haystack requirement of my Windows XP installation.... but I have another tutorial Db which has a listview control and it populates its icons perfectly well..... so it must be a problem with the attached's configuration?

Thanks for the assistance.
 

Attachments

Last edited:
Hi All

Sorry to bump this but I'm still unable to get the icons to display.... any ideas please?
 
Hey, looks like that treeview was corrupted. I just deleted it from the form and put a new one on there. See if this works...
 

Attachments

Brilliant!.... you are a superstar! ... so was I missing something obvious?

Edit ... I've just copied the image control from your version into the treeview I've been developing for a few days and the images do not show? The Treeview does know about the control though cos' if I deliberately corrupt the image key name in the add node, it fails.....
 
Last edited:
Ahhh ... found it

For anyone else out there... double click the Treeview to get the TreeCtrl properties box.... make sure option for Style is set to 7 (tvwTreelinesPlusMinusPictureText) .....

cheers
 

Users who are viewing this thread

Back
Top Bottom