TShellTreeView having some TTreeNode with 2 images lazarus / 31-LCL ---------------------------------------------------------------------- devEric69 · 2021-08-13 07:21 Hello, I'm using a TShellTreeView and its associated TimageList. I associate Node.ImageIndex in the TShellTreeView.OnGetImageIndex event. Now, sometimes I would like to associate 2 images to a node (even several, if I have the trick). I guess I have to paint 2 images on a TRect of the node's Canvas, or something similar. What would those familiar with the TShellTreeView do? ---------------------------------------------------------------------- devEric69 · 2021-08-13 08:46 For info., I've found an example from @howardpc: https://forum.lazarus .freepascal.org/index.php/topic,29374.msg185612.html#msg185612. I'm able to display several images with several subsequential (and x-shifted axis) calls to the associated ImageList1.Draw method (as him, I need a deeper understanding of the various TShellTreeView's painting stages and drawing states...): Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.AdvancedCustomDrawItem(...\...){ completed @howardpc's example }begin    ...\...        PaintImages:= True;    DefaultDraw:= True;   ...\...    ImageList1.Draw(Sender.Canvas, iAx, aRect.Top, iIndex, True);    ImageList1.Draw(Sender.Canvas, iAx + 17, aRect.Top, iIndex+1, True);    Sender.Canvas.TextOut(iAx + 34, aRect.Top, Node.Text);    ...\...    Node.SelectedIndex := Node.ImageIndex;{ <--so that the images are drawn, even when the node is selected }end; ---------------------------------------------------------------------- wp · 2021-08-13 08:58 For two images you could work around by using the StateImages imagelist for the 2nd image (but note that the StateImages are painted to the left of the regular images) - see attached project. If you don't like this, or need more images, you must customdraw the nodes. ---------------------------------------------------------------------- devEric69 · 2021-08-13 10:05 Wow, thanks a lot @wp. I was only using the Images (TImageList) property: I didn't know about the StateImages (TImageList) property. Indeed, for 2 images, using OnGetImageIndex event to assign o_Node.ImageIndex (choice of a 1st image) and using your OnExpanded event to assign o_Node.StateIndex (choice of a second image, displayed alongside), is the easiest thing for me. I only need 2 images, in fact).