{Solved] TShellTreeView replace icons when focus is lost/gained lazarus / 31-LCL ---------------------------------------------------------------------- petevick · 2022-03-25 06:19 What I'd like to do is that when my TShellTreeView looses or gains focus is to change the displayed icon. I have an icon ready to use in my TImageList. I'm already changing the colour of the ExpandingSignColor when focus is lost/gained, but I just can't find a way to change the icon. I'm thinking that maybe I need to make the value in this line in the OnGetImageIndex event  a variable... 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 Node.ImageIndex := 2 // change to.. Node.ImageIndex := xx ...and change xx when focus is lost/gained. ...or maybe it's just not possible to change the icon on the fly ---------------------------------------------------------------------- petevick · 2022-03-25 07:00 Answering my own question. Blimey, after a bit of messing around, using the variable works  I really didn't expect it to be that easy