Lazarus
Using the Lazarus IDE => General => Topic started by: Rostelle on March 03, 2019, 11:16:40 am
-
I am using a TColorListBox and have ended up with more than sixteen colors to choose from. I was trying to insert a divider line to separate the colors at a logical place but can't work out a way to do it.
I can add a color (deliberately just off-white) and give it a name of (row of minus signs) '------' and then simply ignore the off-white color if it is selected but I wondered if there was a better way ?
All the best
-
AFAIK you cannot do this without subclassing TColorListBox to get access to the DrawItem method.
See attached project for a crude approach which draws lines in code, and sets things up in the form's OnCreate.
I suspect making it all published and getting it to work satisfactorily in the Object Inspector would be quite a bit more work, but perhaps you don't need that anyway.
-
howardpc
Apologies for my tardy response
Thanks for your very complete reply including code sample
I have cobbled some of your code into mine and am ploughing on
I am probably being remarkably unobservant but I can't see a mark resolved or mark as useful response option ?
-
I am probably being remarkably unobservant but I can't see a mark resolved or mark as useful response option ?
There isn't any. Just edit your first post and add "[SOLVED]" in the front of the post's "Subject"
-
cheers lucamar