• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 570
  • Last Modified:

Overlay mask in TTreeView

I'm having trouble with displaying overlay masks in a TreeView.

I'm having a treeview with some items with associated icons in it. I'm trying to use an overlay mask for some of these items by setting the OverlayIndex of the TreeNode to e.g. 1. This doesn't work; the original icon is still displayed.

Does anybody have any suggestions or solutions?? Do I forget something? Any help will be appreciated, especially a working example!

Thanks!
0
Arjan092097
Asked:
Arjan092097
  • 2
  • 2
1 Solution
 
BlackManCommented:
As far as I remember, there is a bug relating to OverlayIndex. You can only use index 0 as overlay.
0
 
Arjan092097Author Commented:
With OverlayIndex = 0 it doesn't work either...
0
 
ZifNabCommented:
Do you do it like this?

You have to call TImageList.Overlay first.
Example:
 
ImageList1.Overlay(Image_Index, Overlay_Index);
                           TreeView1.Items[Item_Index].OverlayIndex := Overlay_Index;

Zif.
0
 
Arjan092097Author Commented:
Ok, that works!

Thank you Zif! Just answer the question and you'll get the points :)
0
 
ZifNabCommented:
Hi Arjan,

Here is the answer ;-) :



       You have to call TImageList.Overlay first.
       Example:
         
       ImageList1.Overlay(Image_Index, Overlay_Index);
                                  TreeView1.Items[Item_Index].OverlayIndex := Overlay_Index;

Zif.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now