Click to See Complete Forum and Search --> : StopWatch slower on Win9x


cantolino
September 10th, 2001, 05:28 PM
I'm total beginner in VB and I already had my first headache...
Created this stop watch in VB6 Enterprise SP5, in windows 2000 professional. Created executable file in order to distribute it to my friends.
Guess what: The stopwatch ran 10 times slower in win95 and win98. In other win2000 machines worked beatifully. What's wrong ?????

option Explicit
Dim sec as Integer
Dim min as Integer
Dim mili as Integer

private Sub cmdExit_Click()
'unloads form
Unload frmStpWatch
set frmStpWatch = nothing
End Sub

private Sub cmdReset_Click()
'resets textboxes and variables and disable trmMili
txtMin.Text = "00"
txtSec.Text = "00"
txtMili.Text = "00"
sec = 0
min = 0
mili = 0
tmrMili.Enabled = false

End Sub

private Sub cmdStart_Click()
'starts tmrMili
tmrMili.Enabled = true

End Sub

private Sub cmdStop_Click()
'stops tmrMili
tmrMili.Enabled = false

End Sub
private Sub tmrMili_Timer()
'counts the miliseconds
mili = mili + 1
If mili < 100 then
txtMili.Text = mili
else
mili = 0
sec = sec + 1
txtSec.Text = sec
'counts seconds and minutes
If sec = 60 then
sec = 0
min = min + 1
txtMin.Text = min
txtSec.Text = "00"
End If
End If
End Sub








































































Ed C.B.

cksiow
September 10th, 2001, 07:53 PM
as far as i know, the timer message will only be trigger at most 50ms once... not until 1ms.


HTH

cksiow
http://vblib.virtualave.net - share our codes