you can do something like this:
Private m_iScrollDir As Integer 'Which way to scroll
Private mfX As Single
Private mfY As Single
Private mfInDrag As Boolean
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As _
Any) As Long
'mfInDrag set true in drag start, false in drag end
'TV event
Private Sub moTV_OLEDragOver(Data As MSComctlLib.DataObject, Effect As Long,
Button As Integer, Shift As Integer, x As Single, y As Single, State As
Integer)
mfX = x
mfY = y
'Scroll treeview
If y > 0 And y < 400 Then 'scroll up
' Send a WM_VSCROLL message 0 is up and 1 is down
m_iScrollDir = -1
ElseIf y > (mctlTV.Height - 500) And y < mctlTV.Height Then
'scroll down
m_iScrollDir = 1
Else
m_iScrollDir = 0
End If
End Sub
'Form's event
Private Sub mfrm_Timer()
Static lngStayCount As Long, strStayNode As String
If mfInDrag Then
Set moTV.DropHighlight = moTV.HitTest(mfX, mfY)
If m_iScrollDir = -1 Then 'Scroll Up
' Send a WM_VSCROLL message 0 is up and 1 is down
SendMessage moTV.hWnd, 277&, 0&, vbNull
ElseIf m_iScrollDir = 1 Then 'Scroll Down
SendMessage moTV.hWnd, 277&, 1&, vbNull
End If
End If
End Sub

Signature
Alex Dybenko (MVP)
http://Alex.Dybenko.com
> I finally have succeeded in building a form with a working
> treeview. Everything is running fine. The only thing that
[quoted text clipped - 11 lines]
>
> Thank you for help!
travis - 16 Feb 2004 14:25 GMT
this is my test reply
> you can do something like this:
>
[quoted text clipped - 55 lines]
> >
> > Thank you for help!