Results 1 to 2 of 2

Thread: Copying files with list boxes

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2000
    Posts
    1
    I canot find for the life of me find out to move files when i drag them on top of file list boxes.

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    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]
    Mark
    -------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width