Link to home
Start Free TrialLog in
Avatar of dikonsult
dikonsult

asked on

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.
Avatar of Epsylon
Epsylon

Set for each node in the treeview the ImageIndex and the SelectedIndex. Both must reference an image in the imagelist.
ASKER CERTIFIED SOLUTION
Avatar of Epsylon
Epsylon

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kretzschmar
if you don't want a change



                     node := TreeView1.Items.Add(nil{or whatever}, 'test');
                     node.ImageIndex := 1;
                     node.SelectedIndex := node.ImageIndex;
easy points eps :-)

guessing i can't avoid that you catch me soon

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

I should have caught you already   :o(
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 :-(

;-)
Avatar of dikonsult

ASKER

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?