jaimelopez
October 5th, 2001, 05:19 AM
Hi!
Does anybody know how to change the picture of TreeView when the node is expanded? (I want to show one picture when the node is expanded and another one when the node is not)
Thanks in advance.
Jaime.
jaimelopez
October 5th, 2001, 06:03 AM
I have found it
private Sub TreeView1_Expand(byval Node as MSComctlLib.Node)
Node.Image = 2
End Sub
private Sub TreeView1_Collapse(byval Node as MSComctlLib.Node)
Node.Image = 1
End Sub
Jaime
Cakkie
October 5th, 2001, 06:06 AM
You can use the ExpandedImage property of a node. this must be an index of an image in the associated imagelist (just like the image property).
' both "NORMAL" and "EXPANDED" must be images in the imagelist
Dim N as Node
set N = TreeView1.Nodes.Add Key:="ThisNode", Text:="Some Text"
N.Picture = "NORMAL"
N.ExpandedPicture = "EXPANDED"
Tom Cannaerts
slisse@planetinternet.be
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