Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. tree icon [+] [-]

tree icon [+] [-]

Scheduled Pinned Locked Moved C / C++ / MFC
data-structuresquestionlearning
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    s o v a n n
    wrote on last edited by
    #1

    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.

    J 1 Reply Last reply
    0
    • S s o v a n n

      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.

      J Offline
      J Offline
      Joao Paulo Figueira
      wrote on last edited by
      #2

      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

      S 1 Reply Last reply
      0
      • J Joao 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

        S Offline
        S Offline
        s o v a n n
        wrote on last edited by
        #3

        Your code is definitely very helpful. Now I can customize the [+/-] icon. Thanks, Sovann.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups