How to change the color of text in a listbox

How can i change the color of individual lines of text in a listbox
i'm using visual c++ 5
Thanx in aDvance
Who is Participating?
chensuConnect With a Mentor Commented:
If you want all the text to be the same color, catch the WM_CTLCOLORLISTBOX message (or override CWnd::OnCtlColor for MFC). If you want each line to have different color, create an  owner-draw list box (override CListBox::OnDrawItem, ...).
mwebsterAuthor Commented:
do you have any sample code for an owner drawn listbox
thanx again
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

mwebsterAuthor Commented:
thanx again but the second url does not exist and do you have anything in using visual c++.
The second URL is correct. Try this

Or go to, click "other controls" on the left navigation bar, there are some list box related articles.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.