|
-
August 23rd, 1999, 10:05 AM
#1
Need CTreeCtrl help
Hi everyone. Is there a way to tell if the + or - button/symbol in a CTreeCtrl is double-clicked? The code I am trying to fix intercepts NM_DBLCLK and I would like to do something different if the + or - is double-clicked. It works fine if the item text itself is double-clicked.
Thanks in advance.
mark
-
August 23rd, 1999, 10:32 AM
#2
Re: Need CTreeCtrl help
Hi,
did you try using the function: CTreeCtrl::HitTest
when the user double clicks on the CTreeCtrl ?
with this function you can get the info you need (If the user clicked on the button, on the icon, on the label ...)
I hope it helps,
Isabel Planells
-
August 23rd, 1999, 11:00 AM
#3
Re: Need CTreeCtrl help
I looked into the CTreeCtrl::HitTest method, but it requires you to pass in a CPoint and this method tells you which item covers that point. I do not have access to such a point. All I really want to do is know which item is actually being double-clicked and select (highlight) it when the + or - is double-clicked.
Thanks in advance.
mark
-
August 24th, 1999, 03:12 AM
#4
Re: Need CTreeCtrl help
Hi,
When the user makes a doubleclick on the control, you get the message NM_DBLCLK and make a function for this notification. At the beginning of the function ask to get the position of the cursor(GetCursorPos)and then you have the point you need for the HitTest method.
Greetings,
Isabel
-
August 24th, 1999, 09:12 AM
#5
Re: Need CTreeCtrl help
Thanks to all who posted tips in solving my CTreeCtrl problem. The tree control was a CTreeCtrl in a dialog and I was trying to avoid having to create a new class. However, I did create my own tree control class, derived from CTreeCtrl, intercepted the ON_WM_LBUTTONDBLCLK message within the new class and was able to solve my problem.
Thanks again. I really appreciate it.
mark
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|