精准扶贫产业带动简报:懂vb的朋友帮帮忙

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/28 03:40:30
我做了一个闹钟程序请看看错在哪??

Private Sub Command1_Click()
Dim s, f As Integer
If Option2.Value = True Then
s = CInt(Text4.Text)
f = CInt(Text4.Text)
h = Hour(Time)
m = Minute(Time)
If (h = s) And (m = f) Then
MsgBox "时间到了,你该做你该做你要做的是了!!"
mciSendString "open ""bell.wav"" alias music", vbNull, 0, 0
mciSendString "play music", vbNull, 0, 0

End If
End If

End Sub

就是
不用timer你怎么做到 闹钟 功能~~
你用click当然不行啦~
timer1.in**= 60
或者
要么 你要先设定一个时间 比如上午12:00
再用 类试如 倒计时功能 的东西
时间再慢慢减
到了 12:00 就叫~
具体实现 也是用timer控件
好好看看VB
共同进步~~

你写在了Command1_Click事件里,只在点击Command1的时候调用一次,显示时间。应该把它写成一个方法。用一个Timer控件来调用就行了,不然都触发不到。