Solved

Overlay mask in TTreeView

Posted on 1998-07-13
5
527 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Suggested Solutions

Title # Comments Views Activity
delphi exception 7 68
Delphi Yen format 3 45
Breakpoint doesn't stop in my variable 3 30
firemonkey Android Listview Sort items 7 47
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

807 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