本帖最后由 Casper1185 于 2022-2-25 18:06 编辑
很久没见面了,之前忙着学习
最近抽空写了一个程序------健康提醒器
在这个网络发达的时代,有许多东西让我们着迷
各种影视作品,游戏等,让我们沉迷之无法自拔
但是!!!
我们的身体可能并不适应这些
我们需要上厕所,需要喝水,但是,又是沉迷网络的我们忘记自我
因此,创作灵感来了
这一款健康提醒器,可以让坐在电脑前的你在上网时生活更有条理!
同时我也查阅了一些关于这三项的医学建议,为广大网友指定安全可靠的健康平台
在维护您的健康同时,也少不了一些情趣
更多精彩功能,还请广大网友自己探索!
如使用时发现bug,可以在评论区留言,我将万分感谢!
程序安全无毒
主页的源码公开我将公开,剩余代码或者有什么问题,可以在下方评论区留言,我将尽量一一回复!
程序是用VB写的,比较古老,希望你们能原谅
[Visual Basic] 纯文本查看 复制代码 Private Sub Check1_Click()
If Check1.Value = 1 Then
h.Enabled = True
m.Enabled = True
s.Enabled = True
End If
If Check1.Value = 0 Then
h = 0
m = 0
s = 0
h.Enabled = False
m.Enabled = False
s.Enabled = False
End If
End Sub
Private Sub Check2_Click()
If Check2.Value = 1 Then
h2.Enabled = True
m2.Enabled = True
s2.Enabled = True
End If
If Check2.Value = 0 Then
h2 = 0
m2 = 0
s2 = 0
h2.Enabled = False
m2.Enabled = False
s2.Enabled = False
End If
End Sub
Private Sub Check3_Click()
If Check3.Value = 1 Then
h3.Enabled = True
m3.Enabled = True
s3.Enabled = True
End If
If Check3.Value = 0 Then
h3 = 0
m3 = 0
s3 = 0
h3.Enabled = False
m3.Enabled = False
s3.Enabled = False
End If
End Sub
Private Sub Command1_Click()
If Timer1.Enabled = False And Timer2.Enabled = False And Timer3.Enabled = False Then
Time1 = h
Time2 = m
Time3 = s
Time4 = h2
Time5 = m2
Time6 = s2
Time7 = h3
Time8 = m3
Time9 = s3
Call Timesave
Else
MsgBox "正在计时中,无法进行保存", vbExclamation + vbOKOnly, "出错"
End If
End Sub
Private Sub Command2_Click()
Text1.Text = "开"
End Sub
Private Sub Command3_Click()
Form5.Show
End Sub
Private Sub Command4_Click()
If m.Enabled = True Then
h = 0
m = 30
s = 0
Else
MsgBox "喝水一栏未打勾"
End If
If h2.Enabled = True Then
h2 = 1
m2 = 0
s2 = 0
Else
MsgBox "远眺一栏未打勾"
End If
If h3.Enabled = True Then
h3 = 2
m3 = 0
s3 = 0
Else
MsgBox "厕所一栏未打勾"
End If
End Sub
Private Sub Form_Load()
Call Timeread
h = Time1
m = Time2
s = Time3
h2 = Time4
m2 = Time5
s2 = Time6
h3 = Time7
m3 = Time8
s3 = Time9
Timer4.Enabled = False
Timer1.Enabled = False
h.Enabled = False
m.Enabled = False
s.Enabled = False
Timer2.Enabled = False
h2.Enabled = False
m2.Enabled = False
s2.Enabled = False
Timer3.Enabled = False
h3.Enabled = False
m3.Enabled = False
s3.Enabled = False
End Sub
Private Sub h_KeyPress(KeyAscii As Integer)
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 Then KeyAscii = 0
End Sub
Private Sub h2_KeyPress(KeyAscii As Integer)
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 Then KeyAscii = 0
End Sub
Private Sub h3_KeyPress(KeyAscii As Integer)
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 Then KeyAscii = 0
End Sub
Private Sub Label8_DblClick()
Text1.Text = "关"
End Sub
Private Sub m_KeyPress(KeyAscii As Integer)
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 Then KeyAscii = 0
End Sub
Private Sub m2_KeyPress(KeyAscii As Integer)
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 Then KeyAscii = 0
End Sub
Private Sub m3_KeyPress(KeyAscii As Integer)
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 Then KeyAscii = 0
End Sub
Private Sub s_KeyPress(KeyAscii As Integer)
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 Then KeyAscii = 0
End Sub
Private Sub s2_KeyPress(KeyAscii As Integer)
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 Then KeyAscii = 0
End Sub
Private Sub s3_KeyPress(KeyAscii As Integer)
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 Then KeyAscii = 0
End Sub
Private Sub Label2_Click()
If Check1.Value = 0 And Check2.Value = 0 And Check3.Value = 0 Then
MsgBox "您尚未选择一栏进行计时!"
End If
If h.Enabled = True Then
If h = 0 And m = 0 And s = 0 Then
Timer1.Enabled = False
Else
Timer1.Enabled = Not (Timer1.Enabled)
End If
If Timer1.Enabled = Ture Then
h.Locked = Ture: m.Locked = Ture: s.Locked = Ture
Else
h.Locked = False: m.Locked = False: s.Locked = False
End If
Else
End If
If h2.Enabled = True Then
If h2 = 0 And m2 = 0 And s2 = 0 Then
Timer2.Enabled = False
Else
Timer2.Enabled = Not (Timer2.Enabled)
End If
If Timer2.Enabled = Ture Then
h2.Locked = Ture: m2.Locked = Ture: s2.Locked = Ture
Else
h2.Locked = False: m2.Locked = False: s2.Locked = False
End If
Else
End If
If h3.Enabled = True Then
If h3 = 0 And m3 = 0 And s3 = 0 Then
Timer3.Enabled = False
Else
Timer3.Enabled = Not (Timer3.Enabled)
End If
If Timer3.Enabled = Ture Then
h3.Locked = Ture: m3.Locked = Ture: s3.Locked = Ture
Else
h3.Locked = False: m3.Locked = False: s3.Locked = False
End If
Else
End If
End Sub
Private Sub h_LostFocus()
h = Int(Val(h))
If h < 0 Then h = 0
If h > 23 Then h = 23
End Sub
Private Sub m_LostFocus()
m = Int(Val(m))
If m < 0 Then m = 0
If m > 59 Then m = 59
End Sub
Private Sub s_LostFocus()
s = Int(Val(s))
If s < 0 Then s = 0
If s > 59 Then s = 59
End Sub
Private Sub h2_LostFocus()
h2 = Int(Val(h2))
If h2 < 0 Then h2 = 0
If h2 > 23 Then h2 = 23
End Sub
Private Sub m2_LostFocus()
m2 = Int(Val(m2))
If m2 < 0 Then m2 = 0
If m2 > 59 Then m2 = 59
End Sub
Private Sub s2_LostFocus()
s = Int(Val(s))
If s2 < 0 Then s2 = 0
If s2 > 59 Then s2 = 59
End Sub
Private Sub h3_LostFocus()
h3 = Int(Val(h3))
If h3 < 0 Then h3 = 0
If h3 > 23 Then h3 = 23
End Sub
Private Sub m3_LostFocus()
m3 = Int(Val(m3))
If m3 < 0 Then m3 = 0
If m3 > 59 Then m3 = 59
End Sub
Private Sub s3_LostFocus()
s3 = Int(Val(s3))
If s3 < 0 Then s3 = 0
If s3 > 59 Then s3 = 59
End Sub
Private Sub Timer1_Timer()
If Timer1.Enabled = True Then
h.Enabled = False
m.Enabled = False
s.Enabled = False
End If
If h = 0 And m = 0 And s = 0 Then
Timer1.Enabled = False
Form2.Show
Check1.Value = 0
ElseIf s = 0 Then
s = 59
If m = 0 Then
m = 59: h = h - 1
Else
m = m - 1
End If
Else
s = s - 1
End If
End Sub
Private Sub Timer2_Timer()
If Timer2.Enabled = True Then
h2.Enabled = False
m2.Enabled = False
s2.Enabled = False
End If
If h2 = 0 And m2 = 0 And s2 = 0 Then
Timer2.Enabled = False
Form3.Show
Check2.Value = 0
ElseIf s2 = 0 Then
s2 = 59
If m2 = 0 Then
m2 = 59: h2 = h2 - 1
Else
m2 = m2 - 1
End If
Else
s2 = s2 - 1
End If
End Sub
Private Sub Timer3_Timer()
If Timer3.Enabled = True Then
h3.Enabled = False
m3.Enabled = False
s3.Enabled = False
End If
If h3 = 0 And m3 = 0 And s3 = 0 Then
Timer3.Enabled = False
Form4.Show
Check3.Value = 0
ElseIf s3 = 0 Then
s3 = 59
If m3 = 0 Then
m3 = 59: h3 = h3 - 1
Else
m3 = m3 - 1
End If
Else
s3 = s3 - 1
End If
End Sub
Private Sub Timer4_Timer()
Beep
End Sub
以上是主要代码
健康提醒器修正版.rar
(38.58 KB, 下载次数: 72)
还请大佬们多多关照新人
这是百度盘的
链接:https://pan.baidu.com/s/1FcIT86vT1EfCfIzNF1u8Fg 提取码:52pj
还请各位有币的大佬照顾照顾我
最后声明,我爱吾爱破解
期待下次与你们分享
|