可以考虑弹出一个设计成msgbox样式的窗体,比如我下面的代码
form1中代码
Dim i%
Private Sub Command1_Click()
Form2.Show
End Sub
Private Sub Form_Load()
Timer1.Interval = 1000
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
i = i + 1
Me.Caption = i
End Sub
form2中代码,把form2做的小点,想msgbox那样子,这样程序不会挂起
Private Sub Form_Load()
Form2.Command1.Caption = "确定"
Form2.Caption = "警告"
End Sub
Private Sub Timer1_Timer()
Text2.Text = Time
Label3.Caption = Time
End Sub
Private Sub Timer2_Timer()
If i_time = 0 Then
Beep
Else
i_time = i_time - 1
hour = i_time \ 3600
minute = (i_time Mod 3600) \ 60
second = i_time Mod 60
Text2.Text = Str(hour) + ":" + Str(minute) + ":" + Str(second)
End If
End Sub
Private Sub Timer3_Timer()
Label3.Caption = Time
End Sub
弹出那个就中断程序了 最好别两个同时用