Click to See Complete Forum and Search --> : Drag&Drop


Moses420ca
October 8th, 2001, 02:18 PM
How do I Drag & Drop a file (ie; New Text Document.txt) from the Desktop into my VB5 app and on the drop add the file to a directory or something ie; list box,picture box, whatever. Also can I make it so I can drag & Drop Pics and exe's too?

http://www.geocities.com/moses420ca/images/thumbnails/drewblue2.jpgThankz, Drew
Moses420ca@yahoo.ca

DSJ
October 8th, 2001, 04:04 PM
option Explicit

private Sub Form_Load()
List1.OLEDragMode = 1
List1.OLEDropMode = 1
End Sub

private Sub List1_OLEDragDrop(Data as DataObject, Effect as Long, Button as Integer, Shift as Integer, X as Single, Y as Single)
Dim i as Integer
for i = 1 to Data.Files.Count
List1.AddItem Data.Files(i)
next i
End Sub