I canot find for the life of me find out to move files when i drag them on top of file list boxes.
Printable View
I canot find for the life of me find out to move files when i drag them on top of file list boxes.
try this:
[code]
Private Sub File1_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
Name Data.Files(i) As File1.Path & "\" & StripPath(Data.Files(i))
Next i
File1.Refresh
End Sub
Private Function StripPath(filename) As String
Dim i As Integer
Dim char As String
Dim strOut As String
For i = Len(filename) To 1 Step -1
char = Mid(filename, i, 1)
If char = "\" Then
Exit For
Else
strOut = char & strOut
End If
Next i
StripPath = strOut
End Function
Private Sub Form_Load()
File1.OLEDropMode = 1
End Sub
[code]