hey.. again i wud like to ask for ur help..
im a really newbie to vb6 n a really stupid one..
so.. my teacher want me to test the time on how long does da program save the file to database..
so i have to put timer.. on save capture form,
it has to start from 00:00:00:00 (hr:min:seconds:millisnds) or just min:seconds:millis
so when i click save command button it starts counting and if the file has been saved on da database da timer stops counting, n i can see how long does it takes to save a file to database.. on a label..

i found some articles(on here).. but cant seem to edit it the way i want.. (im sorry for da stupidness)
here is one article i found
http://www.daniweb.com/techtalkforums/thread17352.html
most of it are countdowns and print current time, what i need is start from zero.. 00:00:00:00

can anyone help me?im not good in editing code or anything..
i mean really help me, like in dat forum.. helping me with the code..
thanks aaaaaaaaaaaa lottttttttt
help me.. :sad: :sad: :sad: :sad:

keep separate timers for seconds, minutes and hours.

or try this in vb.net

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Label1.Text = Convert.ToString(DateTime.Now.Hour) + ":" + Convert.ToString(DateTime.Now.Minute) + ":" + Convert.ToString(DateTime.Now.Second)
End Sub

or try this in vb.net

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Label1.Text = Convert.ToString(DateTime.Now.Hour) + ":" + Convert.ToString(DateTime.Now.Minute) + ":" + Convert.ToString(DateTime.Now.Second)
End Sub

but im using vb 6..
i duno how .net works..

try this code pls

Dim hr%, m%, s%
Private Sub Form_Load()
hr = 0
m = 0
s = 0
End Sub

Private Sub hour_Timer()
hr = hr + 1
End Sub

Private Sub min_Timer()
m = m + 1
End Sub

Private Sub sec_Timer()
s = s + 1
Label1.ForeColor = RGB(hr, m, s)
Label1.Caption = hr & ":" & m & ":" & s

End Sub

Adjust the intervals of timers as per ur wish

use the timer function
or use a timer control

either works great.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.