Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / ActiveX Controls / February 2004

Tip: Looking for answers? Try searching our database.

TreeControl

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ACKnow - 23 Dec 2003 14:56 GMT
I finally have succeeded in building a form with a working
treeview. Everything is running fine. The only thing that
lacks perfection is:
I need to drag a node to another node outside the actual
view, but the content of the actual view is not scrolled.
Before starting Drag And Drop you may see a completly
filled TreeView-Object, some parts of the data cannot be
shown because it is too much for the TreeView-Object. If
you use TreeView in Microsoft application you may drag the
node you want to drag to the border of the TreeView-Object
and the content is scrolled (up or down, depends on which
border you have dragged the node).
My TreeView content is not scrolling???

Thank you for help!
Alex Dybenko - 23 Dec 2003 17:57 GMT
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!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.