Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Re: Browse
#1
How do I open multiple files using the commong dialog control? I can just manage to open one at a time.
My code:
Code:
Private Sub add_Click()
    Dim sFile As String

    With dlgCommonDialog
        .DialogTitle = "Open"
        .CancelError = False
        .Filter = "mp3 Files (*.mp3)|*.mp3|"
        .ShowOpen
        If Len(.FileName) = 0 Then
            Exit Sub
        End If
        sFile = .FileName
      
        Dim i As Byte, a As Byte, b As Byte, c As Byte, FileLength As Byte
         a = 0
        For i = 1 To Len(.FileName)
            If Mid(.FileName, i, 1) = "\" Then
                a = a + 1
            Else
                b = b + 1
            End If
        Next i
        
        For i = 1 To Len(.FileName)
            If Mid(.FileName, i, 1) = "\" Then
                c = c + 1
                If c = a Then
                    FileLength = Len(.FileName) - i
                End If
            'Else
            '    b = b + 1
            End If
        Next i
        
        List2.AddItem Mid(.FileName, (Len(.FileName) - FileLength) + 1, Len(.FileName))
        'For i = (Len(.FileName) - FileLength) To Len(.FileName)

        'Next i
        List1.AddItem .FileName
    End With
End Sub
Reply
#2
:o Double post!
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#3
Yeah sure.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)