944,043 Members | Top Members by Rank

Ad:
Jan 16th, 2006
0

timer starts from 00:00:00

Expand Post »
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..
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
psychedelic is offline Offline
2 posts
since Jan 2006
Jan 17th, 2006
0

Re: timer starts from 00:00:00

keep separate timers for seconds, minutes and hours.
Reputation Points: 13
Solved Threads: 2
Light Poster
beuls is offline Offline
40 posts
since Jan 2006
Jan 17th, 2006
0

Re: timer starts from 00:00:00

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
Reputation Points: 13
Solved Threads: 2
Light Poster
beuls is offline Offline
40 posts
since Jan 2006
Jan 17th, 2006
0

Re: timer starts from 00:00:00

Quote originally posted by beuls ...
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..
Reputation Points: 10
Solved Threads: 0
Newbie Poster
psychedelic is offline Offline
2 posts
since Jan 2006
Jan 22nd, 2006
0

Re: timer starts from 00:00:00

try this code pls

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Dim hr%, m%, s%
  2. Private Sub Form_Load()
  3. hr = 0
  4. m = 0
  5. s = 0
  6. End Sub
  7.  
  8. Private Sub hour_Timer()
  9. hr = hr + 1
  10. End Sub
  11.  
  12. Private Sub min_Timer()
  13. m = m + 1
  14. End Sub
  15.  
  16. Private Sub sec_Timer()
  17. s = s + 1
  18. Label1.ForeColor = RGB(hr, m, s)
  19. Label1.Caption = hr & ":" & m & ":" & s
  20.  
  21. End Sub

Adjust the intervals of timers as per ur wish
Reputation Points: 13
Solved Threads: 2
Light Poster
beuls is offline Offline
40 posts
since Jan 2006
Jan 27th, 2006
0

Re: timer starts from 00:00:00

use the timer function
or use a timer control

either works great.
Reputation Points: 11
Solved Threads: 3
Banned
tom curren is offline Offline
51 posts
since Oct 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: connection to a remote database
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Is anyone up to a challenge?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC