Results 1 to 2 of 2

Thread: Dropping file over Treeview

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Oct 2000
    Posts
    1,463

    Dropping file over Treeview

    I searched all over but should not find an answer to this.

    I want to drag an MP3 file over the Treeview controll anywhere. When this happens, I want to use an event to do something with the MP3 file. i will determine where to insert it into the treeview. How can I tell its an MP3 file and use the file?

    Thanks ahead!

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Dropping file over Treeview

    You would have to use Treeview1_OLEDragDrop event handler and also set OleDropMode to Manual.
    Code:
    Private Sub TreeView1_OLEDragDrop(Data As MSComctlLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)
    Dim i%
    
        If (Effect And vbDropEffectCopy) Then
            If Data.Files.Count > 0 Then
                For i = 1 To Data.Files.Count
                    TreeView1.Nodes.Add , , , Data.Files(i)
                Next i
            End If
        End If
        
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width