[SOLVED] Icon of TTreeNode vanishes when node is selected lazarus / 31-LCL ---------------------------------------------------------------------- EganSolo · 2021-12-19 23:00 Like the title says: I've got a TTreeView with a bunch of nodes. Each node has an associated icon loaded from an image list. Whenever a node is selected, I see the node's text but the icon vanishes. The nodes are added programmatically as follows: 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    aNode := TreeView.Items.Add(Nil, 'Some Text');   aNode.ImageIndex := 10; //Could be any index in the image list  I've got the following options set: 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    tvoHideSelected := false;   tvoHotTrack     := True;   tvoReadOnly   := True;   tvo_ShowButtons := false;   tvo_ShowLines   := false;   tvo_ShowRoot    := false;  What am I missing? Thanks ---------------------------------------------------------------------- wp · 2021-12-20 00:04 You must also assign the SelectedIndex of the node: 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 aNode := TreeView.Items.Add(Nil, 'Some Text');aNode.ImageIndex := 10; //Could be any index in the image listaNode.SelectedIndex := aNode.ImageIndex; ---------------------------------------------------------------------- EganSolo · 2021-12-24 02:24 Thanks wp! That did it.