It really drives me mad. I am trying to drag a listview item and drop it into a treeview sub node. The sound is pretty easy. However, when I have a long list of the tree view. the OLEDragOver event seems cannot find a correct curors position, which affect on the treeview dropHighlight and even it is impossible to highlight the last few nodes of the bottom treeview.
Can anyone help me?
Can anyone help me?
Code:
Private Sub tvClass_OLEDragOver(Data As MSComctlLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single, State As Integer)
Dim xNode As Node
Set xNode = tvClass.HitTest(X, Y)
If xNode Is Nothing Then
mbIndrag = False
Else
If xNode.Children <> 0 Then
Set tvClass.DropHighlight = Nothing
mbIndrag = False
Else
Set tvClass.DropHighlight = xNode
mbIndrag = True
End If
End If
End Sub