Link to home
Start Free TrialLog in
Avatar of Arjan092097
Arjan092097

asked on

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!
Avatar of BlackMan
BlackMan

As far as I remember, there is a bug relating to OverlayIndex. You can only use index 0 as overlay.
Avatar of Arjan092097

ASKER

With OverlayIndex = 0 it doesn't work either...
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.
Ok, that works!

Thank you Zif! Just answer the question and you'll get the points :)
ASKER CERTIFIED SOLUTION
Avatar of ZifNab
ZifNab

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial