|
-
Jun 6th, 2006, 07:55 AM
#1
Thread Starter
PowerPoster
[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!
Last edited by Muddy; Jun 6th, 2006 at 11:58 AM.
Reason: resolved
-
Jun 6th, 2006, 09:06 AM
#2
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
-
Jun 6th, 2006, 11:57 AM
#3
Thread Starter
PowerPoster
Re: drag and drop windows file icons into listbox
Exactly what I need ... Very nice! Thanks!
And I was imagining a complex API solution ...
-
Mar 6th, 2013, 10:34 AM
#4
Lively Member
Re: drag and drop windows file icons into listbox
Thank you , you are beautiful
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|