• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 397
  • Last Modified:

Image changing when select node in TreeView

I have a imagelist to my treeview and set imageindex to each node when building the tree.
When selecting a node the image is changed to the image corresponding to imageindex 0 and changes back to the correct image when selecting other node.
I have checked all my events and they do not affect the imageindex in any way.
Tryed use the OnGetImageIndex and OnGetSelectedIndex to change imageindex to the right one but then recive a runtime error.
0
dikonsult
Asked:
dikonsult
  • 3
  • 3
1 Solution
 
EpsylonCommented:
Set for each node in the treeview the ImageIndex and the SelectedIndex. Both must reference an image in the imagelist.
0
 
EpsylonCommented:
It must be something like this:

node := TreeView1.Items.Add(nil{or whatever}, 'test');
node.ImageIndex := 1;
node.SelectedIndex := 0;
0
 
kretzschmarCommented:
if you don't want a change



                     node := TreeView1.Items.Add(nil{or whatever}, 'test');
                     node.ImageIndex := 1;
                     node.SelectedIndex := node.ImageIndex;
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
kretzschmarCommented:
easy points eps :-)

guessing i can't avoid that you catch me soon

meikl ;-)
0
 
EpsylonCommented:
I don't like difficult question on an early Sunday afternoon  :o)

I should have caught you already   :o(
0
 
kretzschmarCommented:
well, maybe you did it already :-)
(the point updates in ex-ex takes a bit time)

and you did it really at the top 100 :-(

;-)
0
 
dikonsultAuthor Commented:
hey, if you have a argument please have that somewhere else. I know it was a simple question but 200p really got me an fast answer, didn't it?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now