I need the whole background one color
Printable View
I need the whole background one color
Yes, you paint the background with a HBRUSH, and text background with SetBkColor().
Or you use an owner draw listbox and write a paint function for it. Harder to do but much more control. Different columns / rows / items can have different colours / fonts ect.
Calling the paint function in response to a WM_DRAWITEM msg.
In the ListBoxRepaint function;Code:case WM_DRAWITEM:
pDrawItem = (DRAWITEMSTRUCT *)lParam;
Find the text with LVM_GETITEMTEXT and SendMessage()
Find the column widths with LVM_GETCOLUMNWIDTH and so find the column's client rectangle.
Work out where you want the text with GetTextExtentPoint32() and so the text's client rectangle.
FrameRect() and FillRect() to colour in as well as SetBkColour() and SetTextColour().
I have described the procedure here (with a little example in C)
http://board.win32asmcommunity.net/s...&threadid=1519
LuHa.