Hola, como podria hacer un drag and drop sobre una carpeta y poder conocer el destino de esta carpeta, para poder abrir un archivo en forma binarya.
si yo utilizo este metodo
Private Sub ListView1_OLEStartDrag(Data As ComctlLib.DataObject, AllowedEffects As Long)
Dim i As Long
For i = 1 To ListView1.ListItems.Count
If ListView1.ListItems.Item(i).Selected = True Then
Data.Files.Add ListView1.ListItems(i).Tag
Data.SetData , vbCFFiles
End If
Next
End Sub
es nesesario que el archivo ya exista (ListView1.ListItems(i).Tag) pero esto me obliga a no poder continuar modificandolo.
mi nececidad es crearlo luego de haber hecho el drag and drop.
Es posible esto?
mira son las 4 am en argentina ! pero si tomas cada archivo cargado independientemente en un arrqay (?)
o q a cada archivo lo cargues en un straing para abrirlo ! noc si veo algo mejor te digo Lenadro
bye . tucuman !
Hola Leandro, investigando y experimentando un poco (encima que en google solo encontras info de Drag&Drop hacia algun control y no desde este hacia otro lado) llegue a esto:
Dim i As Long
Dim path As String
Private Sub Form_Load()
lst.ListItems.Add , , "Hola"
lst.ListItems.Add , , "Adios"
lst.ListItems.Add , , "Bye"
lst.OLEDragMode = ccOLEDragAutomatic
End Sub
Private Sub lst_OLEStartDrag(Data As ComctlLib.DataObject, AllowedEffects As Long)
For i = 1 To lst.ListItems.Count
If lst.ListItems.Item(i).Selected = True Then
path = App.path & "\" & lst.ListItems(i).Text & ".txt"
Open path For Output As #1
Print #1, lst.ListItems(i).Text
Close #1
Data.Files.Add path
Data.SetData , vbCFFiles
End If
Next
AllowedEffects = OLEDropEffectConstants.vbDropEffectMove
End Sub
See... como se aprecia se crea el archivo "en vivo" lo cual podra ralentizarlo un poco, pero bueno, es la unica forma que encontre :P