tree icon [+] [-]
-
Hi! I wanted a tree control with different back color, line color, and [+/-] icon. To archive the former, I tried CTreeCtrl::SetBkColor and CTreeCtrl::SetLineColor, then it works. But there is trouble with the default [+/-] icon. I wanted the [+/-] inside a circle. I created 2 icons in resource for that, then tried CWnd::SetIcon big/small for +/-, but the default icon never changes. What should I do? Thanks, Sovann.
-
Hi! I wanted a tree control with different back color, line color, and [+/-] icon. To archive the former, I tried CTreeCtrl::SetBkColor and CTreeCtrl::SetLineColor, then it works. But there is trouble with the default [+/-] icon. I wanted the [+/-] inside a circle. I created 2 icons in resource for that, then tried CWnd::SetIcon big/small for +/-, but the default icon never changes. What should I do? Thanks, Sovann.
Check this article: QA: How can I change the background color of a Tree Control?[^] It is not only about changing the background color, it also addresses your proble and although it was written for the Pocket PC, I think you will be able to use this code on the desktop as well. Regards, João Paulo Figueira
-
Check this article: QA: How can I change the background color of a Tree Control?[^] It is not only about changing the background color, it also addresses your proble and although it was written for the Pocket PC, I think you will be able to use this code on the desktop as well. Regards, João Paulo Figueira
Your code is definitely very helpful. Now I can customize the [+/-] icon. Thanks, Sovann.