Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help on Treeview OLEDragOver event

Status
Not open for further replies.

wangdong

Programmer
Joined
Oct 28, 2004
Messages
202
Location
CN
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?

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
 
Please, anyone help me!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top