We help IT Professionals succeed at work.

Coloring rows in CListCtrl

JShaft
JShaft asked
on
I have a CListCtrl with several rows of data. In the case that there is an error on one of the rows, I want to change the text to be red only on that row. I assume I have to do this using an owner drawn CListCtrl, but I don't know how to do it. Also, if there is a way to do it without doing an owner drawn control, that would be great. Thanks a lot!
Comment
Watch Question

Commented:
Check out the following link in the Codeguru.
http://www.codeguru.com/listview/row_color.shtml


Hope this is what you want.
Sr Program Manager
Commented:
Hi,

I guess, it can be easily done with Custom draw. Take a look at

http://www.codeguru.com/listview/CustomDraw.shtml

Just specify only the text color and not the back color. That should do. Only thing is u need to remember the row number where u want the different color and check it here. That should do the trick.

Try it out.
VinExpert

Author

Commented:
Thanks, Thangs! Your answer does seem to offer a solution, but the solution VinExpert pointed me to seems more like what I wanted (i.e., simple).

Explore More ContentExplore courses, solutions, and other research materials related to this topic.