Solved

TreeView ImageList problem.

Posted on 2001-09-10
3
562 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

911 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