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. Is it possible to add check to for each tree items instead of all?

Is it possible to add check to for each tree items instead of all?

Scheduled Pinned Locked Moved C / C++ / MFC
data-structuresquestion
3 Posts 2 Posters 1 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.
  • E Offline
    E Offline
    eagle51
    wrote on last edited by
    #1

    hi Is it possible to add check to for each tree items in CTreeCtrl instead of all

    EmptyBox

    J 1 Reply Last reply
    0
    • E eagle51

      hi Is it possible to add check to for each tree items in CTreeCtrl instead of all

      EmptyBox

      J Offline
      J Offline
      Jason Teagle
      wrote on last edited by
      #2

      The check boxes in trees and list controls are done by creating an image list. The image list is applied to every item in the same manner. To get check boxes for individual items, you cannot use this feature. Instead, create your own image list for the blank (no checkbox), empty check box and filled checkboxes, and whenever you insert an item into the tree, set the appropriate image to check box or no checkbox. It does mean, though, that you will need to process NM_CLICK to 'toggle' the check state by updating the item's image accordingly.

      E 1 Reply Last reply
      0
      • J Jason Teagle

        The check boxes in trees and list controls are done by creating an image list. The image list is applied to every item in the same manner. To get check boxes for individual items, you cannot use this feature. Instead, create your own image list for the blank (no checkbox), empty check box and filled checkboxes, and whenever you insert an item into the tree, set the appropriate image to check box or no checkbox. It does mean, though, that you will need to process NM_CLICK to 'toggle' the check state by updating the item's image accordingly.

        E Offline
        E Offline
        eagle51
        wrote on last edited by
        #3

        hey Jason, you are so clear, thx for your reply :)

        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