Public a
Public b
Public c
Private Sub Command1_Click()
a = Hour(Time)
b = Minute(Time)
c = Second(Time) + 3
If a > 12 Then
a = a - 12
End If
If b > 60 Then
a = a + 1
b = b - 60
End If
List1.AddItem Combo1 & " " & Combo2 & " " & Time & "〖学习〗" & " " & "〖休息时间〗" & a & ":" & b & ":" & c
End SubPrivate Sub Command2_Click()
List1.RemoveItem 0
End SubPrivate Sub Command3_Click()
End
End SubPrivate Sub Form_Load()Me.Caption = "时间器"
Combo1.List(0) = "起  床"
Combo1.List(1) = "睡觉咯"Combo2.List(0) = "早上"
Combo2.List(1) = "中午"
Combo2.List(2) = "晚上"End SubPrivate Sub Timer1_Timer()
If Hour(Time) = a And Minute(Time) = b And Second(Time) = c Then
MsgBox "时间到~!!!!!!!!!", vbOKOnly, "提示"
End If
End Sub
Private Sub Timer2_Timer()
Frame1.Caption = "现在时间" & Time
End Sub

解决方案 »

  1.   

    lz 只有一个定时,执行一次,已经给你面子了。Private Sub Timer1_Timer()
      If Hour(Time) = a And Minute(Time) = b And Second(Time) = c Then
        MsgBox "时间到~!!!!!!!!!", vbOKOnly, "提示"
      End If
    End Sub
      
    ————————————————————————————————————
    写作,虽然每个人都会查阅辞海,可,不是人人都能写出不朽的篇章的。编程,如是也。
      

  2.   


    虽然定时器是周期监测的,但你的a,b,c不是变化的,你的a,b,c设定一次,当然只执行一次,如果你不停的改变你的a,b,c,那才会不停执行阿
      

  3.   

    yao 把这段代码放在timer1中
    abc还可以把定时作为全局变量,然后从文本框中取得,将
      

  4.   

    yao 把这段代码放在timer1中
    abc还可以把定时作为全局变量,然后从文本框中取得,将