时钟示例。设计一个计时报警程序,开始时窗体上显示当前时间,单击“开始”按钮10秒钟后程序结束。 

解决方案 »

  1.   

    Dim num As IntegerPrivate Sub Command1_Click()
    Timer2.Enabled = True
    Label2.Visible = True
    End SubPrivate Sub Form_Load()
    Timer2.Enabled = False
    Timer2.Interval = 1000
    Timer1.Enabled = True
    Timer1.Interval = 50
    Label2.Visible = False
    num = 10
    End SubPrivate Sub Timer1_Timer()
    Label1.Caption = Time
    Label2.Caption = num
    End SubPrivate Sub Timer2_Timer()num = num - 1
    If num = 0 Then
    End
    End If
    End Sub