Solved

TreeView ImageList problem.

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

809 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