vb 里面怎么用drivelistbox打开任意盘符

来源:百度知道 编辑:UC知道 时间:2024/06/02 21:05:10
就是我把下拉表拉到C盘 他就自动打开C盘 拉到D盘 他就自动打开D盘.........要速度帮我下哈... 废话多的不要来啦.

Private Sub Drive1_Change()
Path = Split(Drive1.Drive, ":")
Shell "explorer " & Path(0) & ":", vbNormalFocus
End Sub

画上个drivelistbox控件、dirlistbox和filelistbox,
然后写下代码:
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub

Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
就行了。