Option Explicit
Dim alarmtime
Private Sub Command1_Click()
Call dialog
End Sub
Private Sub Command2_Click()
alarmtime = InputBox("请输入想设定的时间,例如(19:00:00)", "小闹钟")
If alarmtime = "" Then
End If
If (IsDate(alarmtime) = False) Then '如果alarmtime为日期格式或可以转为date,返回true,否则返回false
MsgBox "输入的不是时间格式,请重试!", vbExclamation, "wrong"
Else
alarmtime = CDate(alarmtime) '将alarmtime转为日期格式
End If
End Sub
Private Sub Command3_Click()
Call deng
End Sub
Private Sub Command4_Click()
End
End Sub
Private Sub Form_Load()
Command3.Enabled = 0
alarmtime = ""
End Sub
Private Sub Form_Resize() '如果最小化,则显示时间,还原则显示小闹钟
If WindowState = 1 Then
mintime
Else
Caption = "小闹钟"
End If
End Sub
Sub mintime()
Caption = Format(Time, "long time")
End Sub
Private Sub Timer1_Timer()
If Label2.Caption <> CStr(Time) Then 'cdate,cstr,cint强制类型转换
La

这是一个使用VB编写的简单小闹钟程序,用户可以输入设定的时间,并选择在到达设定时间时执行的程序。程序通过检查当前时间是否已达到或超过设定的闹钟时间,触发执行用户选择的可执行文件。
最低0.47元/天 解锁文章
285

被折叠的 条评论
为什么被折叠?



