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!
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