|
-
October 12th, 2001, 06:40 AM
#1
How to change the image on a node in a treeview ctrl?
Hi I would like to know if there is any way to change the image on an node in a treeview.
I have all my images in an imagelist
I would like to have a diffrent image if a parent node contains children node's or not.
I would also like to know if this is possible to do in VBA as well - since I want to use it primery in Access 2000
Thanks in Advance - Goftnar the Swede
-
October 12th, 2001, 08:22 AM
#2
Re: How to change the image on a node in a treeview ctrl?
After populating the treeview, try this:
Dim N as Node
for Each N In TreeView1.Nodes
If N.Children > 0 then
N.Image = "NodeWithChildren"
else
N.Image = "NodeWithoutChildren"
End If
next N
Of course, there must be an image in the associated imagelist that has a key "NodeWithChildren" and one with the key "NodeWithoutChildren"
Tom Cannaerts
[email protected]
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|