... Instead I usually add a second image list which is linked to StateImages of the treeview; this imagelist contains two icons, a checked and a non-checked icon. ...
I first tried your code but that didn't work at all. But the reason could be that hadn't loaded an ImageList yet (never heard of it). So I started looking, found it, looked for some more explanation on the Web how to use it, just double-click it, but then bumped in an article about the use of it in combination with TreeView. It was quite simple:
TreeView1.StateImages :=ImageList1;
TreeView1.Images :=ImageList1;
....
NewNode := Treeview1.Items.Add (nil, 'All jobs');
TreeView1.Items[0].Selected := True;
NewNode.ImageIndex :=0;
NewNode.SelectedIndex :=1;
NewNode.StateIndex :=2;
This "All jobs" node had a V in front of it. (This V was an icon I had to make myself). But to be honest, I have not a complete idea what is going on but I will find out by playing with the numbers a bit....
Kind regards/groetjes, Ruud Baltissen
www.baltissen.org