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 / July 2004

Tip: Looking for answers? Try searching our database.

Treeview Control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DP - 04 May 2004 20:13 GMT
Has anyone had any luck with Access and the Treeview control, trying drag
and drop, to get the "createdrageimage" to work?

The following code compiles, but then fritzes when you actually move the
mouse over the treeview control:

TreeView1.DragIcon = TreeView1.SelectedItem.CreateDragImage
     TreeView1.Drag vbBeginDrag

As I understand it, this is supposed to give you a ghosted image of the item
being dragged.

I'd love for it to work...

David Pike
Alex Dybenko - 05 May 2004 09:06 GMT
i think CreateDragImage does not work in access, at least i didnt find any
way to make it work

Signature

Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com

> Has anyone had any luck with Access and the Treeview control, trying drag
> and drop, to get the "createdrageimage" to work?
[quoted text clipped - 11 lines]
>
> David Pike
Mark Johnson - 07 Jul 2004 14:57 GMT
>Has anyone had any luck with Access and the Treeview control, trying drag
>and drop, to get the "createdrageimage" to work?

It's easy. In this example, the source tview is on one subform, the
receiving tview on another. Both on the same form.

On the treeview subform, if say the tview is called - tvwCat:

Private Sub tvwCat_MouseDown(ByVal Button As Integer, ByVal Shift As
Integer, ByVal x As Long, ByVal Y As Long)

   Me!tvwCat.Object.SelectedItem = Me!tvwCat.Object.HitTest(x, Y)

End Sub

Private Sub tvwCat_OLEStartDrag(Data As Object, AllowedEffects As
Long)
   Dim nod As node
   Set nod = Me!tvwCat.SelectedItem
   
   If Not nod Is Nothing Then Data.SetData nod.Text & "," &
Mid(nod.Key, 2) & "," & <etc>

End Sub

On the subform with the tview, here called tvwCatalog, to receive the
dragged item:

Private Sub tvwCatalog_OLEDragDrop(Data As Object, Effect As Long,
Button As Integer, Shift As Integer, x As Single, Y As Single)

   ' data is comma delim 'record' from drag tvw - key, tag, table
name
   strT = Data.GetData(vbCFText)

. . .

' MS Clipboard constants
Public Const vbCFText = 1
 
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.