Click to See Complete Forum and Search --> : Listbox font and background color?


WhorlyWhelk
September 5th, 2007, 07:34 PM
Is it possible to color my listbox? I would like the background to be grey with the font multiple colors, mainly red font with certain letters a different color for contrast.

Is this possible with the LISTBOX control??

Or would it be better to just draw my list of things myself using graphics?

kirants
September 5th, 2007, 08:47 PM
Read up MSDN on Owner-drawn List Boxes

WhorlyWhelk
September 5th, 2007, 08:56 PM
I have looked at it. It says you can change the background color of the listbox using ownerdrawn. I am wondering if you can change more than that, specifically the text color.

kirants
September 6th, 2007, 01:22 PM
Sure. The WM_DRAWITEM will give you a handle to a DC. You can change the DC properties using SetTextColor etc.