CommonDialog1.ShowOpen 把进程给勾住了。
就像Msgbox一样!
怎么解决?
CommonDialog1.ShowOpen 把进程给勾住了。
就像Msgbox一样!
怎么解决?
你可以自己建一个CommonDialog窗体,只要不用show 1就行了 CommonDialog用的是一些系统的api
自己做个简单点的就行了,最简单的用filelist
CommonDialog1属于模式窗体型。不关闭的话,你是没法操作其他窗口的,
如果SHOWOPEN了,还想操作其他窗口的话,那么,只能自己写一个类似这个对话框的窗体了
Option Explicit Dim Fils() As String Dim FilCount As Integer Private Sub Command1_Click() Dim i As Integer CommonDialog1.ShowOpen If CommonDialog1.FileName <> ““ Then If FilCount > 0 Then For i = 0 To FilCount - 1 If Fils(i) = CommonDialog1.FileName Then Exit Sub Next End If ReDim Preserve Fils(FilCount) Fils(FilCount) = CommonDialog1.FileName Text1.Text = Fils(FilCount) FilCount = FilCount + 1 End If End Sub Private Sub Command2_Click() ReDim Fils(0) FilCount = 0 End Sub Private Sub Command3_Click() Dim i As Integer If FilCount = 0 Then MsgBox “没有记录文件“: Exit Sub For i = 0 To FilCount - 1 Me.Print Fils(i) Next End Sub Private Sub Form_Load() Text1.Text = ““ Command1.Caption = “打开文件“ Command2.Caption = “清空“ Command3.Caption = “显示所有文件“ End Sub