I’m trying to use the HitTest method to give me the node at X,Y. It gives an Invalid Procedure Call or Argument:
Dim NodeW as Ctreeviewnode
Set Nodew = Plist.HitTest(x,y) ' FailureAh
NodeW = PList HitTest(x,y) ' Failure
I have tried everything I could think of to get it to work. I cannot assign the return value of the method to a node.
Ed Epstein
Contact Point LLC
|
This is a copy/paste type bug. The arrowed line in the code is wrong:
Public Function hitTest(ByVal X As Single, ByVal Y As Single) As cTreeViewNode
'
Dim tVHT As TVHITTESTINFO
Dim lID As Long
fUnScale X, Y, tVHT.pt.X, tVHT.pt.Y
SendMessage m_hWnd, TVM_HITTEST, 0, tVHT
If Not (tVHT.hItem = 0) Then
>> lID = m_colIDs(CStr(tVHT.hItem))
Dim nod As New cTreeViewNode
nod.fInit Me, lID
Set hitTest = nod
End If
'
End Function
It should read
lID = fIDForhItem(hItem)
|
Fixed. |