手揣网教程:绿色安全纯净官方版,体验当今速度最快的浏览器!

“打开”对话框一起选择多个文件

时间:2024/12/21作者:未知来源:手揣网教程人气:

[摘要]Private Sub Command1_Click() On Error GoTo userCanceled Dim i As Integer With CommonDialog...
Private Sub Command1_Click()
    On Error GoTo userCanceled
    Dim i As Integer
    With CommonDialog1
        .CancelError = True
        .Flags = cdlOFNHideReadOnly Or cdlOFNAllowMultiselect Or cdlOFNExplorer Or cdlOFNNoDereferenceLinks
        .Filter = "所有文件(*.*) *.*"
        .ShowOpen
        GetFileInfo (.FileName)
    End With
    List1.Clear
    For i = 1 To UBound(FileInfo)
        List1.AddItem FileInfo(i)
    Next
    Label3 = FileInfo(0)
userCanceled:
End Sub
Private Sub GetFileInfo(Source As String)
    Dim t As Integer
    FileInfo = Split(Source, Chr(0))
    If UBound(FileInfo) = 0 Then
        ReDim Preserve FileInfo(1)
        t = InStrRev(FileInfo(0), "\")
        FileInfo(1) = Mid(FileInfo(0), t + 1)
        FileInfo(0) = Left(FileInfo(0), t)
    Else
        If Right(FileInfo(0), 1) <> "\" Then FileInfo(0) = FileInfo(0) & "\"
    End If
End Sub

关键词:“打开”对话框一起选择多个文件




Copyright © 2012-2018 手揣网教程(http://www.shouchuai.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版