From: shubhishubhi on
Hello Guys,

I am working on a simple program where I want a CTreeCtrl with lines,
checkboxes, imagelists and background color for each item.

I am not sure how to add background color for the items so that each item
can have custom back color.

Suggesstions are welcome.

Cheers
From: Goran on
On Jan 4, 3:18 pm, shubhishubhi
<shubhishu...(a)discussions.microsoft.com> wrote:
> Hello Guys,
>
> I am working on a simple program where I want a CTreeCtrl with lines,
> checkboxes, imagelists and background color for each item.
>
> I am not sure how to add background color for the items so that each item
> can have custom back color.
>
> Suggesstions are welcome.
>
> Cheers

Look for such a control on the internet. I'm pretty sure that somebody
already made a control with a custom-drawn background color and lines
and checkboxes are already available as styles. Image list
manipulation is orthogonal and you should have all you need in
CImageList class.

If you have to do it yourself (I think that you don't), off the top of
my head, try overriding NM_CUSTOMDRAW notification and acting when
dwDrawStage==CDDS_ITEMPOSTERASE.

Goran.
From: Seetharam on
Best place to find such samples:

http://www.codeproject.com/KB/tree/

-Seetharam