[RESOLVED] drag and drop windows file icons into listbox
Has anyone done this in VB6? I want to be able to drag (a) file icon(s) from anywhere on the windows desktop to a listbox on a vb6 app form and have the full filepath(s) appear in the listbox.
If anyone can point me to some example code or suggest an approach I would be grateful.
Thanks!
Re: drag and drop windows file icons into listbox
set the ListBox's OLEDropMode to 1-Manual, then:
VB Code:
Private Sub List1_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim vFile As Variant
If Data.GetFormat(vbCFFiles) Then
For Each vFile In Data.Files
List1.AddItem vFile
Next vFile
End If
End Sub
Re: drag and drop windows file icons into listbox
Exactly what I need ... Very nice! Thanks!
And I was imagining a complex API solution ... :)
Re: drag and drop windows file icons into listbox
Thank you , you are beautiful