Board index » delphi » treeview selected item

treeview selected item

After populating my treeview (D6) with text and icons from my imagelist.  The static view looks great; however, when I select an node the image/graphic changes to one from my imagelist.  How do I prevent D6 from substituting a different graphic when an item is selected?  I tried using the oncustomdrawitem event, by turning default draw off and painting the correct graphic and text it worked well, but I then lost the horizontal and vertical lines in the treeview.  If you can lend some advice on the custom draw or preventing the graphic from changing, I would appreciate it.

Patrick Kriech

 

Re:treeview selected item


Patrick,  I can't check right now,  but I believe that treeview items have 2
image properties.
Something like ImageIndex and SelectedIndex.

Make sure both indexes are the same.

Regards

Re:treeview selected item


Quote
"RandomAccess" <R...@ndomAccess.com> wrote:
>Patrick,  I can't check right now,  but I believe that treeview items have 2
>image properties.
>Something like ImageIndex and SelectedIndex.

>Make sure both indexes are the same.

>Regards

That was the correct answer.  Thanks for the help.

PK

Other Threads