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