Solved

Overlay mask in TTreeView

Posted on 1998-07-13
5
526 Views
Last Modified: 2008-02-01
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
Comment
Question by:Arjan092097
  • 2
  • 2
5 Comments
 
LVL 7

Expert Comment

by:BlackMan
ID: 1357767
As far as I remember, there is a bug relating to OverlayIndex. You can only use index 0 as overlay.
0
 

Author Comment

by:Arjan092097
ID: 1357768
With OverlayIndex = 0 it doesn't work either...
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1357769
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
 

Author Comment

by:Arjan092097
ID: 1357770
Ok, that works!

Thank you Zif! Just answer the question and you'll get the points :)
0
 
LVL 8

Accepted Solution

by:
ZifNab earned 200 total points
ID: 1357771
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

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

785 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