Click to See Complete Forum and Search --> : Need CTreeCtrl help
abbomar
August 23rd, 1999, 10:05 AM
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
Isabel Planells
August 23rd, 1999, 10:32 AM
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
abbomar
August 23rd, 1999, 11:00 AM
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
Isabel Planells
August 24th, 1999, 03:12 AM
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
abbomar
August 24th, 1999, 09:12 AM
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
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.