多窗口的选择,这个程序不行?

muxi02 2004-05-08 09:50:19
Private Sub Command1_Click()
Unload Me
End Sub

Private Sub mnuexit_Click()
Unload Me
End Sub

Private Sub mnuopen_Click()
Dim i As Integer
Dim y As Integer
Dim z As Integer
Dim filenames$()
CommonDialog1.FileName = ""
CommonDialog1.Filter = "all files|*.*"
CommonDialog1.Flags = cdlofnallownultiselect
CommonDialog1.Action = 1
CommonDialog1.FileName = CommonDialog1.FileName & Chr(32)
z = 1
For i = 1 To Len(CommonDialog1.FileName)
i = InStr(z, CommonDialog1.FileName, Chr(32))
If i = 0 Then Exit Sub
ReDim Preserve filenames(y)
filenames(y) = Mid(CommonDialog1.FileName, z, i - z)
z = i + 1
y = y + 1
Next
List1.Clear
If y = 1 Then
List1.AddItem filenames(0)
Else
For i = 1 To y - 1
List1.AddItem filenames(0) & "\" & filenames(i)
Next
End If

End Sub
...全文
11 回复 点赞 打赏 收藏 举报
写回复
回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
相关推荐
发帖
控件
加入

1430

社区成员

VB 控件
申请成为版主
帖子事件
创建了帖子
2004-05-08 09:50
社区公告
暂无公告