1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
Private Sub ListView1_OLEDragDrop(Data As MSComctlLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)
Dim Long_Chaine As Long
Dim PosCar_1 As Long 'Defini la position du dernier "\"
Dim NomFile As String
StrPath = Data.Files(1)
Long_Chaine = Len(StrPath)
For PosCar_1 = (Long_Chaine) To 1 Step -1
If Mid(StrPath, PosCar_1, 1) = "\" Then GoTo Suite
Next
Suite:
NomFile = Right(StrPath, (Long_Chaine - PosCar_1))
With ListView1
.ListItems.Add , , NomFile
.ListItems(.ListItems.Count).ListSubItems.Add , , StrPath
.Refresh
End With
End Sub |
Partager