I posted this yesterday under "Forms", but after receiveing no responses, it dawned on me this morning that it should have been posted under "Modules", so I deleted the other one and I am reposting it here.
Problem: When dragging an item far on a treeview (out of the current view), the treeview doesn't automatically scroll, forcing the user to drop the item before they get where they are going. Then they have to pick it up and drag it again and again to get to the top (or bottom) of the tree.
Unhelpful gripe about the treeview control: Why the #~!!@)$! doesn't it scroll automatically??!! Who built this s@#*??!!
My attempts at solving this: I found this: http://support.microsoft.com/kb/177743 which explains how to manually scroll the tree while dragging. This seems to be the relevant portion of the example:
But it isn't directly applicable because the example is for a VB application, not a VBA application in Access. It looks like it is using API calls though, so maybe I could do the same sort of thing in Access, if only I could understand what they are doing.
My question(s): Has anyone successfully implemented anything like this in VBA? Can you share? I don't know anything about VB, can anyone who knows something about VB suggest a way in which the MS KB example could be applied in Access? I don't think this is a RTFM, but if it is, could you kindly direct me towards such manual?
In case it matters:
OS: XP
Access: 2003
Treeview control: version 6.0
Problem: When dragging an item far on a treeview (out of the current view), the treeview doesn't automatically scroll, forcing the user to drop the item before they get where they are going. Then they have to pick it up and drag it again and again to get to the top (or bottom) of the tree.
Unhelpful gripe about the treeview control: Why the #~!!@)$! doesn't it scroll automatically??!! Who built this s@#*??!!
My attempts at solving this: I found this: http://support.microsoft.com/kb/177743 which explains how to manually scroll the tree while dragging. This seems to be the relevant portion of the example:
Code:
Private Sub Timer1_Timer()
Set TreeView1.DropHighlight = TreeView1.HitTest(mfX, mfY)
If m_iScrollDir = -1 Then 'Scroll Up
' Send a WM_VSCROLL message 0 is up and 1 is down
SendMessage TreeView1.hwnd, 277&, 0&, vbNull
Else 'Scroll Down
SendMessage TreeView1.hwnd, 277&, 1&, vbNull
End If
End Sub
My question(s): Has anyone successfully implemented anything like this in VBA? Can you share? I don't know anything about VB, can anyone who knows something about VB suggest a way in which the MS KB example could be applied in Access? I don't think this is a RTFM, but if it is, could you kindly direct me towards such manual?
In case it matters:
OS: XP
Access: 2003
Treeview control: version 6.0