Solved

TreeView ImageList problem.

Posted on 2001-09-10
3
560 Views
Last Modified: 2012-06-22
Hi.

I'm altering the "Items" property of a treeview at runtime by enumerating a DB table and adding the records in under their appropriate headings.

This is all fine, but then I decided to add images to the items.  The problem I found is that when I click on an item in the treeview, it automatically reverts to an ImageIndex of 0, even though it's 1 (for example).  When I click another item, it goes back to what it should be.  It seems that every item, when clicked, gets it's image from index 0.  I do not want this.  I want items to retain their own icon, even when selected.  To be honest, if this isn't a bug, I don't see any useful reason for it.

Any ideas?

John.
0
Comment
Question by:Jaymol
  • 2
3 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 50 total points
ID: 6470118
provide also an selected_index for your node
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6470124
usual the same as the imageindex
0
 
LVL 6

Author Comment

by:Jaymol
ID: 6470127
Oh yeah.  I see now.  (Donkey!)

Thanks.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This video discusses moving either the default database or any database to a new volume.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

762 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now