小弟最近初學剛要寫一個碼表程式
但是.....寫完發現時間很不準
懇請各位大大求助
PS 我的interval設10
Public Class Form1
Public Start_Status As Boolean
Public Time_Count As Long
Private Sub cmdStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdStart.Click
Start_Status = True
End Sub
Private Sub cmdStop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdStop.Click
Start_Status = False
End Sub
Private Sub cmdReset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdReset.Click
Time_Count = 0
Label1.Text = "00:00"
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim lSec As Long
Dim lMin As Long
If Start_Status = True Then
Time_Count = Time_Count + 1
lMin = Time_Count \ 6000
lSec = (Time_Count Mod 6000) \ 100
Label1.Text = Format(lMin, "00") & ":" & Format(lSec, "00")
End If
End Sub
End Class
This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers.
留言列表