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. Tree Control with Checkboxes ....

Tree Control with Checkboxes ....

Scheduled Pinned Locked Moved C / C++ / MFC
data-structurestutorialquestion
2 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.
  • R Offline
    R Offline
    rohit dhamija 0
    wrote on last edited by
    #1

    :zzz:Dear All, I am developing an application in which I require a "tree control with checkboxes". The structure of tree control is as: Main_Root Child_1 Child_2 Child_3 Child_4 Child_5 Child_6 ie. simple tree having one main root and having many child items. I have two problems related to it. 1) All child items should be checked to TRUE whenever we click checkbox of 'root 'item and vice-versa. How to proceed for it ??????? I mean to say that which event should I capture for this.( ie. TVN_SELCHANGING ) 2) Is there any way to disable a particular check-box in tree control. Please send some code for this if possible. Thanks in advance. Rohit

    A 1 Reply Last reply
    0
    • R rohit dhamija 0

      :zzz:Dear All, I am developing an application in which I require a "tree control with checkboxes". The structure of tree control is as: Main_Root Child_1 Child_2 Child_3 Child_4 Child_5 Child_6 ie. simple tree having one main root and having many child items. I have two problems related to it. 1) All child items should be checked to TRUE whenever we click checkbox of 'root 'item and vice-versa. How to proceed for it ??????? I mean to say that which event should I capture for this.( ie. TVN_SELCHANGING ) 2) Is there any way to disable a particular check-box in tree control. Please send some code for this if possible. Thanks in advance. Rohit

      A Offline
      A Offline
      AnkushChopra
      wrote on last edited by
      #2

      Hi Rohit I have no practical experience with checkboxes in tree, but have worked a lot with trees otherwise, but I think I might be able to help you. For your first question, you can do the following steps 1. Once you click the root item you can traverse the children and then the subsequent siblings with a HTREEITEM. First use treename.GetChildItem(/*HTREEITEM*/ hItem) and check it, then you can use a while loop to check all other siblings by using treename.GetNextSiblingItem(/*HTREEITEM*/ hItem) Try out the above suggestion, if you need help then please do let me know Ankush

      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