Change ScrollBar color lazarus / 31-LCL ---------------------------------------------------------------------- Edson · 2017-10-25 20:57 I need to change the Scrollbars color of a ListBox, a TreeView, and a SynEdit component. Is there some property or event to do this, or what other alternatives exist? ---------------------------------------------------------------------- jamie · 2017-10-26 01:01 Not easy..  a scrollbar most of the time is part of the main control. for example the listbox has a scrollbar but it is automatically create when you create the listbox.  Windows sets all the needed items for the scrollbar control when it creates the listbox for you.  You can get at the scrollbar. You need to EnumChildWindows looking for the "SCROLLBAR" control class.  when you find it, it'll give you a handle to the control.   With this handle you can alter the colors using API functions but I am not sure how retained they will be  SetBkColor should do it..   You need to experiment a little..   Look on the net for getting the handle to a scrollbar control in a listbox and the other controls will work the same way.    P.S.    I also use this method to get the Listbox handle of a Combobox to make sure it works back to Win2k..   Starting some where around vista MS gave a message to obtain it, but nothing earlier.  Happy hunting ---------------------------------------------------------------------- RAW · 2017-10-26 01:08 I guess the easiest crossplatform way would be to create your own scrollbar and disable the scrollbars of the other controls, but I have no experience with this... ---------------------------------------------------------------------- jamie · 2017-10-26 02:25 Memory is now coming back, scrollbar handles on some Windows controls are not accessible which is when its a good time to make your own control and use a stand alone scrollbar control. ---------------------------------------------------------------------- PatBayford · 2017-10-26 04:53 I strongly suspect that scroll bars are very low level, and hence managed by the OS APIs. I'm not at all sure that any changes made will survive a re-draw! I am, as usual, prepared to be proven wrong!!