Wednesday, 12 September 2018

Delphi - Add an icon to a Node in TTreeView


1. Add your tree view to the form.

2. Add an TImageList to the form.

3. Double click on the ImageList component and add some images in.

4. Go to the Properties of the TreeView > Drop down the 'Images' property and select the name of the ImageList you've added.


5. Now in your code, where you're populating the treeview, you can add in code to set an icon/image to each node by referncing the image index:

//This will set the image of the node when resting
MyNode.ImageIndex := 0;  

//This will set the image of node when selected
MyNode.SelectedIndex := 0;

The index number refers to the image in the IMageList. This is zero based so the first image would be 0, the second would 1 and so on...

 

1 comment:

  1. Top 10 Casino Games Near Philadelphia (Pennsylvania)
    Casino games near me 포항 출장마사지 on Mapyro. 충주 출장마사지 Search for casinos in Pennsylvania 청주 출장안마 in 2021. See detailed reviews, ratings, & 밀양 출장마사지 phone 경기도 출장마사지 number of all casinos in

    ReplyDelete