Page 1 of 1

Drag'n Drop Files

Posted: 25 Oct 2010, 04:20
by Rucksacktraeger
Hi!

With Standard Textboxes I can Drop Files like this:

Code: Select all

Private Sub txtFile_OLEDragDrop(data As DataObject, effect As Long, button As Integer, shift As Integer, x As Single, y As Single)
   MsgBox data.Files.item(1)
End Sub
It returns the path and filename of the dropped file.

Is this also possible with your Controls? I didn't manage it.

Code: Select all

Private Sub txtFileU_OLEDragDrop(ByVal data As EditCtlsLibUCtl.IOLEDataObject, effect As EditCtlsLibUCtl.OLEDropEffectConstants, ByVal button As Integer, ByVal shift As Integer, ByVal x As Single, ByVal y As Single)
    MsgBox data. ... ???
End Sub

Re: Drag'n Drop Files

Posted: 25 Oct 2010, 06:43
by TiKu
The setup contains a Drag'n'Drop sample which should help you.

Code: Select all

  If Data.GetFormat(vbCFFiles) Then
    On Error GoTo NoFiles
    files = Data.GetData(vbCFFiles)
    For i = LBound(files) To UBound(files)
      MsgBox files(i)
    Next i
NoFiles:
  End If

Re: Drag'n Drop Files

Posted: 26 Oct 2010, 03:12
by Rucksacktraeger
oops, I'm sorry. I always checked your examples. But in this case i didn't. Next time, I know