如何分别把文件夹下的图片都调入到pictuer控个中一次.这样我才能批量处理文件夹下的所有图片呀!谢谢~`定给分!!

解决方案 »

  1.   

    用一个FileListBox就行了。如果不想显示它就设为Visible=false
    如果需要穷举子目录使用DIR命令判断子目录中有无文件。
      

  2.   

    可以用API,想方便的话用FSO
    Dim fso As Object
    Dim ff as object
    Set fso=CreateObject("Scripting.FileSystemObject")
    set fd=fso.getfolder("你的文件目录")
    for each f in fd.files '遍历文件夹的文件对象集合
        if lcase(right(f.name,4)=".bmp" '如果是图片文件,自己指定条件
              Picture1.picture=loadpicture(f.Path & "\" & f.Name) '将他载入
        end if
    next
      

  3.   

    Option Explicit'引用microsoft scripting runtime对象
    Private Sub Command1_Click()
        Dim FSO As New FileSystemObject
        Dim File As File
        
        Dim Folder As Folder
        
        Set Folder = FSO.GetFolder("D:\")
        For Each File In Folder.Files
            If File.Type Like "BMP*" Or File.Type Like "JPEG*" Or File.Type Like "JPG*" Then
                MsgBox File.Name
                Picture1.Picture = LoadPicture("D:\" & File.Name)
            End If
        Next
        Set Folder = Nothing
        Set FSO = Nothing
    End Sub
      

  4.   

    Athickhead 正解~不过得在循环里加个延时~否则很快的。