Please Help! How to set color for Tree Control chield items

Hello,
 
I am using VC++ 6.0
In the project I create tree control in the window using the following code:
 
hwndLVt = CreateWindowEx(WS_EX_STATICEDGE,WC_TREEVIEW, "",   
                                         WS_VISIBLE | WS_CHILD | 
                                         WS_EX_STATICEDGE|
                                         TVS_HASLINES | TVS_HASBUTTONS |     
                                         TVS_TRACKSELECT | 
                                        TVS_SINGLEEXPAND |   
                                        TVS_FULLROWSELECT | TVS_INFOTIP |    
                                         VS_LINESATROOT,
                                          10,10,500,435,
                                          hwndParent,
                                        (HMENU)IDC_LISTVIEW,
                                          ghInstApp,
                                       NULL);
 
In this tree control I want to be able to set different colors for child 
items?
How I can do it?

Thank you,
Pola

0
Pola1 (7)
11/23/2005 12:52:03 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
589 Views

Similar Articles

[PageSpeed] 50

This functionality is not directly available in tree control. You will
need to handle NM_CUSTOMDRAW to accomplish it.

--------
Ajay Kalra
ajaykalra@yahoo.com

0
ajaykalra (6842)
11/23/2005 1:35:47 PM
Here is an example:

http://www.codeproject.com/treectrl/colortreectrl.asp

AliR.

"Pola" <Pola@discussions.microsoft.com> wrote in message
news:7E67AA54-B63E-4CAE-8B67-1090364BD523@microsoft.com...
> Hello,
>
> I am using VC++ 6.0
> In the project I create tree control in the window using the following
code:
>
> hwndLVt = CreateWindowEx(WS_EX_STATICEDGE,WC_TREEVIEW, "",
>                                          WS_VISIBLE | WS_CHILD |
>                                          WS_EX_STATICEDGE|
>                                          TVS_HASLINES | TVS_HASBUTTONS |
>                                          TVS_TRACKSELECT |
>                                         TVS_SINGLEEXPAND |
>                                         TVS_FULLROWSELECT | TVS_INFOTIP |
>                                          VS_LINESATROOT,
>                                           10,10,500,435,
>                                           hwndParent,
>                                         (HMENU)IDC_LISTVIEW,
>                                           ghInstApp,
>                                        NULL);
>
> In this tree control I want to be able to set different colors for child
> items?
> How I can do it?
>
> Thank you,
> Pola
>


0
AliR3470 (3236)
11/23/2005 4:14:01 PM
Reply:

Similar Artilces: