Solved

Image changing when select node in TreeView

Posted on 2001-07-01
7
371 Views
Last Modified: 2010-04-06
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
Comment
Question by:dikonsult
  • 3
  • 3
7 Comments
 
LVL 13

Expert Comment

by:Epsylon
ID: 6242101
Set for each node in the treeview the ImageIndex and the SelectedIndex. Both must reference an image in the imagelist.
0
 
LVL 13

Accepted Solution

by:
Epsylon earned 200 total points
ID: 6242109
It must be something like this:

node := TreeView1.Items.Add(nil{or whatever}, 'test');
node.ImageIndex := 1;
node.SelectedIndex := 0;
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6242115
if you don't want a change



                     node := TreeView1.Items.Add(nil{or whatever}, 'test');
                     node.ImageIndex := 1;
                     node.SelectedIndex := node.ImageIndex;
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 27

Expert Comment

by:kretzschmar
ID: 6242242
easy points eps :-)

guessing i can't avoid that you catch me soon

meikl ;-)
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 6242308
I don't like difficult question on an early Sunday afternoon  :o)

I should have caught you already   :o(
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6242325
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
 

Author Comment

by:dikonsult
ID: 6242857
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question