读书人

选中Dir1控件新建的那个文件

发布时间: 2014-01-22 14:50:12 作者: rapoo

求助 选中Dir1控件新建的那个文件
Private Sub Image1_建_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image1_建.BorderStyle = 1
Dim i As Long, strPath As String
strPath = Dir1.Path & "\新建文件夹"
i = 1
If Dir(strPath, vbDirectory) > "" Then '2
Do Until Dir(strPath & i, vbDirectory) = ""
i = i + 1
Loop
MkDir strPath & i
求助选中这个文件夹的代码?
Else
MkDir strPath
求助选中这个文件夹的代码?
End If
Dir1.Refresh '1
End Sub

[解决办法]
建立目录后刷新源目录,查找新建的文件夹的listindex值,然后设置 dir1.listindex=查找值即可

读书人网 >VB

热点推荐