求帮忙用VB做一个倒计时软件,要求如下
1:界面如下图(2)用户输入指定的时间值,每秒钟更新一次显示的剩余时间;(3)单击“开始”按钮,即开始计时;计时时间到,响铃;(4)单击“暂停”按钮,停止计时,再单击“开...
1:界面如下图
(2)用户输入指定的时间值,每秒钟更新一次显示的剩余时间;
(3)单击“开始”按钮,即开始计时;计时时间到,响铃;
(4)单击“暂停”按钮,停止计时,再单击“开始”按钮,继续计时;
(5)单击“重计”按钮,可重新输入计时时间在线等,谢谢!速度快可加分 展开
(2)用户输入指定的时间值,每秒钟更新一次显示的剩余时间;
(3)单击“开始”按钮,即开始计时;计时时间到,响铃;
(4)单击“暂停”按钮,停止计时,再单击“开始”按钮,继续计时;
(5)单击“重计”按钮,可重新输入计时时间在线等,谢谢!速度快可加分 展开
展开全部
Dim S As Integer, F As Integer, M As Integer
Dim PLAG As Integer
Private Sub Command1_Click()
Command1.Enabled = False
Command2.Enabled = True
Command3.Enabled = False
If PLAG = 0 Then
S = Val(Text1)
F = Val(Text2)
M = Val(Text3)
PLAG = 1
End If
Text4 = TIMES(S, F, M)
Timer1.Enabled = True
End Sub
Private Sub Command2_Click()
Timer1.Enabled = False
Command1.Enabled = True
Command2.Enabled = False
Command3.Enabled = True
End Sub
Private Sub Command3_Click()
PLAG = 0
End Sub
Private Sub Command4_Click()
End
End Sub
Private Sub Form_Load()
Text4 = ""
Timer1.Enabled = False
PLAG = 0 '第一次计时
End Sub
Function TIMES(i As Integer, j As Integer, k As Integer) As String
a1 = Right("00" & i, 2)
a2 = Right("00" & j, 2)
a3 = Right("00" & k, 2)
TIMES = a1 & ":" & a2 & ":" & a3
End Function
Private Sub Timer1_Timer()
If S = 0 And F = 0 And M = 0 Then Timer1.Enabled = False: Exit Sub
M = M - 1
If M < 0 Then
M = 59
F = F - 1
If F < 0 Then
F = 59
S = S - 1
End If
End If
Text4 = TIMES(S, F, M)
End Sub
Dim PLAG As Integer
Private Sub Command1_Click()
Command1.Enabled = False
Command2.Enabled = True
Command3.Enabled = False
If PLAG = 0 Then
S = Val(Text1)
F = Val(Text2)
M = Val(Text3)
PLAG = 1
End If
Text4 = TIMES(S, F, M)
Timer1.Enabled = True
End Sub
Private Sub Command2_Click()
Timer1.Enabled = False
Command1.Enabled = True
Command2.Enabled = False
Command3.Enabled = True
End Sub
Private Sub Command3_Click()
PLAG = 0
End Sub
Private Sub Command4_Click()
End
End Sub
Private Sub Form_Load()
Text4 = ""
Timer1.Enabled = False
PLAG = 0 '第一次计时
End Sub
Function TIMES(i As Integer, j As Integer, k As Integer) As String
a1 = Right("00" & i, 2)
a2 = Right("00" & j, 2)
a3 = Right("00" & k, 2)
TIMES = a1 & ":" & a2 & ":" & a3
End Function
Private Sub Timer1_Timer()
If S = 0 And F = 0 And M = 0 Then Timer1.Enabled = False: Exit Sub
M = M - 1
If M < 0 Then
M = 59
F = F - 1
If F < 0 Then
F = 59
S = S - 1
End If
End If
Text4 = TIMES(S, F, M)
End Sub
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询