Ten minute timer ???

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Dec 2006
Posts: 3
Reputation: Dogfish is an unknown quantity at this point 
Solved Threads: 1
Dogfish Dogfish is offline Offline
Newbie Poster

Ten minute timer ???

 
0
  #1
Dec 12th, 2006
:cheesy: Brief Intro: I am new to Visual Basic but have been playing with a USB PC Interface and have got to grips with some VERY basic VB6 commands and am trying to expand my "vocabulary" with hopefully the help of your kind and learned selves.

Best Wishes for the Festive Season and here goes.



I want to set a timer from a button click to run for ten minutes then go off, but can only get the timer in vb6 to run for 10000 milliseconds ! any help would be great.


Thanks Newbie Dogfish

P.S.

Sorry for posting in the wrong area before this ( you know what we're like, play with the remote first, then read the manual when you can't get it working)
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 3,117
Reputation: WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of 
Solved Threads: 282
Moderator
WaltP's Avatar
WaltP WaltP is offline Offline
Posting Sensei

Re: Ten minute timer ???

 
0
  #2
Dec 13th, 2006
Originally Posted by Dogfish View Post
I want to set a timer from a button click to run for ten minutes then go off, but can only get the timer in vb6 to run for 10000 milliseconds ! any help would be great.
I don't know why you can't go higher than 10000, I just loaded a timer with 60000 -- 1 minute. 70000 was too large.

Regardless, you can just count the number of times the timer kicks off, and when it gets to the 10-minute count, you're done.
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 848
Reputation: QVeen72 is on a distinguished road 
Solved Threads: 120
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Practically a Posting Shark

Re: Ten minute timer ???

 
0
  #3
Dec 13th, 2006
Hi,

Set these properties for Timer Control :
Interval = 10000
Enabled = False
Place A Command Button cmdStart on the Form.
Caption ="Start"

Keep a Form Level Variable MyTime

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Dim MyTime As Long
  2.  
  3. Private Sub cmdStart_Click()
  4. MyTime = 0
  5. Timer1.Enabled =True
  6. cmdStart.Enabled = False
  7. End Sub
  8.  
  9. Private Sub Timer1_Timer()
  10. MyTime = MyTime +1
  11. If MyTime >= 60 Then
  12. MyTime = 0
  13. Timer1.Enabled = False
  14. MsgBox "Time Out!!"
  15. cmdStart.Enabled = True
  16. End If
  17. End Sub

I Hope It IS Clear
Regards
Veena
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC