Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Image changing when select node in TreeView

Posted on 2001-07-01
7
Medium Priority
?
379 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 800 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

715 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