To the Ineffable All,
Does anyone know how to make colored text lines in listboxes. It's a snap to use WM_CTLCOLORLISTBOX, and then change the text color and background. BUT, that changes ALL the text lines in a listbox to the same color and background. I am looking to make each line I write to a listbox a different color and background. Is that possible? Ratch
Ratch,
Yes, you can do that by putting the listbox control onto a richedit window. It is probablly overkill but I acquired an addressbook application from someon, forgot who. There were 3 rows of columns per entry so the author decided to change background colors for each entry. I will post it, if you like. The zip is 35,164 bytes.
Paul
My suggestion is: use a listview with 1 column to emulate the listbox. With the listview, use the CUSTOMDRAW feature.
Listbox has OWNERDRAW styles (LBS_OWNERDRAWFIXED, LBS_OWNERDRAWVARIABLE) -- pick one and go from there :wink
I'd go with fixed.
To the Ineffable All,
Listbox with LBS_OWNERDRAWFIXED style works great. Capture WM_DRAWITEM and use TextOut or DrawItem. Thanks to all and especially Tedd. Ratch