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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Insert icons CTreeCtrl (some items only)

Insert icons CTreeCtrl (some items only)

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 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.
  • _ Offline
    _ Offline
    _Flaviu
    wrote on last edited by
    #1

    Is there any way to insert some icons to an CTreeCtrl, but only on some icons, and other one's not ? If yes, how can I do that ?

    L 1 Reply Last reply
    0
    • _ _Flaviu

      Is there any way to insert some icons to an CTreeCtrl, but only on some icons, and other one's not ? If yes, how can I do that ?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      you set the icon group via CTreeCtrl::SetImageList[^], and then use the offset into the list to set the icon for individual tree items. If you use an invalid offset then no icon will be displayed.

      _ 1 Reply Last reply
      0
      • L Lost User

        you set the icon group via CTreeCtrl::SetImageList[^], and then use the offset into the list to set the icon for individual tree items. If you use an invalid offset then no icon will be displayed.

        _ Offline
        _ Offline
        _Flaviu
        wrote on last edited by
        #3

        Yes, I try that, but remain there an ugly empty space (between tree line and tree text) ...

        L 1 Reply Last reply
        0
        • _ _Flaviu

          Yes, I try that, but remain there an ugly empty space (between tree line and tree text) ...

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          That's the space for the icon, nothing you can do about it. You could use an image that just contains a line so it extends to the actual tree item.

          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