Sign in to follow this  
Followers 0
pingpong123

TreeView Event Notification

4 posts in this topic

Hi All,

I have created a treeview control which has checkbox and +/- button against each item. I couldn't able to find a way to know as when the user check/uncheck or click on +/- buttons of a particular tree view item.......

I am using GUIGetMsg() but it is giving the notification only when the user single click on the item but it is not giving any info when user checks the checkbox of the item....Is there any way to accomplish this task...

Any help would be highly appreciated....

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi,

GUIRegisterMsg() would probably be the best way to catch msgs when the tree item is clicked..

Myself I used the $WM_NOTIFY msg in combination with API Constants of TVM_HITTTEST and $TVHT_ONTITEMSTATEICON to register the Checkbox as being clicked...

Cheers

Edit: the reason I needed to know if a checkbox is being clicked is so I could set the unexpanded children to be checked or unchecked as well.

Edited by smashly

Share this post


Link to post
Share on other sites

Yeah, even I tried out the same way by making use of TVN_ITEMEXPANDED notifications but it is giving the control Id of the tree but not of the items...but it's really funny that they haven't provided a quick way to see which tree item has been checked/+/- button pressed

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

$TVHT_ONTITEMBUTTON , use that to find if a + or - button has been hit...

$TVHT_ONTITEMSTATEICON , if a check box has been hit...

Edit: If your using the above with register msg then you'll need to declare them as a constant..

To get a great list of windows constants then have a look in the downloads section for Windows APIConstants , that someone else has already done the hard yards and put together a gui listing a majority of them to make your life easier..

Edited by smashly

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0