Solved

Overlay mask in TTreeView

Posted on 1998-07-13
5
530 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…

730 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