Lira_Renzo
New Member
Pessoal, estou tentando fazer um cronometro simples mas ele não inicia a contagem de jeito nenhum. alguém pode me ajudar?
Dim countH As Long
Sub Globals
Dim countMM As Long
Dim countSEC As Long
Private lblChrono As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("capa")
'cria o chronometro
lblChrono.Text = NumberFormat(countH, 2, 0) & ":" & NumberFormat(countMM, 2, 0) & ":" & NumberFormat(countSEC, 2, 0)
End Sub
Sub timer1_tick()
countSEC = countSEC + 1
If (countSEC = 60) Then
countSEC = 0
countMM = countMM + 1
If (countMM = 60) Then
countMM = 0
countH = countH + 1
End If
End If
Return
End Sub
Sub btnChronoOn_Click
'btn aciona o crono
timer1.Interval = 1
timer1.Initialize("timer1", 1)
timer1.Enabled = True
End Sub
Valeu pessoal.
Dim countH As Long
Sub Globals
Dim countMM As Long
Dim countSEC As Long
Private lblChrono As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("capa")
'cria o chronometro
lblChrono.Text = NumberFormat(countH, 2, 0) & ":" & NumberFormat(countMM, 2, 0) & ":" & NumberFormat(countSEC, 2, 0)
End Sub
Sub timer1_tick()
countSEC = countSEC + 1
If (countSEC = 60) Then
countSEC = 0
countMM = countMM + 1
If (countMM = 60) Then
countMM = 0
countH = countH + 1
End If
End If
Return
End Sub
Sub btnChronoOn_Click
'btn aciona o crono
timer1.Interval = 1
timer1.Initialize("timer1", 1)
timer1.Enabled = True
End Sub
Valeu pessoal.