Individual rows Clistctrl background color

Feb 16, 2012 at 12:27pm

Hi all,

Visual studio 2008
OS: XP
C++ MFC.

I'm trying while focusing an item from my clistctrl search in the whole list if there are items related to that item and highlight them.

Basically right now I'm stuck on how to change their background color without painting the whole clist.

so for example
A:{C,D} C and D are related to A

If we have this items in the CListctrl the result should be like this:

A:Focused
B:common background color
C:Different background color (Same Bkg colour than D)
D:Different background color (same Bkg colour than C)
E: common background color
...

Im not really an expert with MFC so any help will be appreciated.
So if there is a easy way to do it or whatever helps it would be great.

NMLVCUSTOMDRAW im gonna try to use that but the example i found.. was for
coloured text so i hope there is no problem with that.

Thanks in advance

Regards
Feb 16, 2012 at 12:43pm
By the way is a CListctrl report view
Feb 20, 2012 at 8:44am
Anyone knows how to do it and give me some guidelines? thanks


regards
Feb 20, 2012 at 9:44am
Have you tried the codeguru or the codeproject websites?
Feb 21, 2012 at 3:22pm
Thanks, at the end with customdraw I was able to do it

Regards
Topic archived. No new replies allowed.