Yes it is. You first must use
Public Declare Function SendMessageLong _
Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, lParam As Long) As Long
put that it in public variable or api call class
also place in the forms timer event
Private Sub Form_Timer()
Set trvw.DropHighlight = trvw.HitTest(mfX, mfY)
If Scrollup Then
SendMessageLong trvw.hWnd, 277&, 0&, vbNull
Else
SendMessageLong trvw.hWnd, 277&, 1&, vbNull
End If
End Sub
declare at module level
Private mfX As Single
Private mfY As Single
Private WithEvents trvw As TreeView
Private Scrollup As Boolean
you will also need to test the drag over event
Private Sub TrVw_OLEDragOver(Data As MSComctlLib.DataObject, Effect As Long,
Button As Integer, Shift As Integer, x As Single, y As Single, STATE As
Integer)
On Error GoTo HandleErr
If indrag = True Then
Set trvw.DropHighlight = trvw.HitTest(x, y)
mfX = x
mfY = y
If y > 0 And y < 100 Then 'scroll up
Scrollup = True
Me.TimerInterval = 100
ElseIf y > (Me.TreeView8.Height - 200) And y < Me.TreeView8.Height Then
Scrollup = False
Me.TimerInterval = 100
Else
Me.TimerInterval = 100
End If
End If
exithere:
Exit Sub
HandleErr:
If QueueError(Err) Then GoTo exithere: On Error GoTo 0: Resume
End Sub