如何让filelist控件有dirlist和drivelist?
就是普通文件列表:上面选择目录,下面选择文件?
或有其它控件?
请尽快帮忙,有效就给分。

解决方案 »

  1.   

    选择目录需要DriListBo控件
      

  2.   

    例:
    Option ExplicitPrivate Sub Dir1_Change()
        File1.Path = Dir1.Path
    End SubPrivate Sub Drive1_Change()
        Dir1.Path = Drive1.Drive
    End SubPrivate Sub File1_Click()
        Dim blnF As Boolean
        Dim intI As Integer
        blnF = False
        For intI = 0 To List1.ListCount
    '如果已经在列表框中存在,再次单击则将其从列表框中清除
            If File1.FileName = List1.List(intI) Then
                List1.RemoveItem intI
                blnF = True
            End If
        Next intI
        If blnF = False Then
    '如果在列表框中不存在,则将被单击文件加入列表框
            List1.AddItem File1.FileName
        End If
    End Sub
    Private Sub Form_Load()
        Me.Caption = "文件控件_选择文件"
        Label1.Caption = "驱动器:"
        Label2.Caption = "目录:"
        Label3.Caption = "文件:"
        Label4.Caption = "选出的文件:"
    End Sub