问题在文本里面。有几句话不明白
这是一个到计时的响应代码。由于是看的别人的。所以有几句不明白Dim hour, minute, second
Private Sub Command1_Click()
If Command1.Caption = "开始计时" Then
Timer1.Enabled = True
Command1.Caption = "停止计时"
Text1.Enabled = False
h1.Enabled = False
m1.Enabled = False
s1.Enabled = False
Else
Timer1.Enabled = False
Command1.Caption = "开始计时"
Text1.Enabled = True
h1.Enabled = True
m1.Enabled = True
s1.Enabled = True
End If
End Sub
Private Sub Form_Load()
Text1.Text = Time()
time1 = Split(Time(), ":")
hour = CInt(time1(0))
minute = CInt(time1(1))
second = CInt(time1(2))
End Sub
Private Sub Timer1_Timer()
'Print Str(s) + "-" + Str(m) + "-" + Str(h)
If second > 0 Then
second = second - 1
End If
If second < 1 And minute > 0 Then
minute = minute - 1
second = 60
End If
If minute < 1 And second = 0 And hour > 0 Then
hour = hour - 1
minute = 60
End If
If hour < 0 Then
hour = 0
End If
If minute < 0 Then
minute = 0
End If
Text1.Text = Trim(Str(hour)) + ":" + Trim(Str(minute)) + ":" + Trim(Str(second))
If hour = Int(h1.Text) And minute = Int(m1.Text) And second = Int(s1.Text) Then
MsgBox ("时间到了")
End If
End Sub
Text1.Text = Time()
time1 = Split(Time(), ":")
hour = CInt(time1(0))
minute = CInt(time1(1))
second = CInt(time1(2)) 是阐述的个什么意思?还有下面的
'Print Str(s) + "-" + Str(m) + "-" + Str(h)
If second > 0 Then
second = second - 1
End If
If second < 1 And minute > 0 Then
minute = minute - 1
second = 60
End If
If minute < 1 And second = 0 And hour > 0 Then
hour = hour - 1
minute = 60
End If
If hour < 0 Then
hour = 0
End If
If minute < 0 Then
minute = 0 太多的不明白。麻烦那位哪个过路说明下。