943,930 Members | Top Members by Rank

Ad:
Dec 12th, 2006
0

Ten minute timer ???

Expand Post »
: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)
Similar Threads
Reputation Points: 10
Solved Threads: 1
Newbie Poster
Dogfish is offline Offline
3 posts
since Dec 2006
Dec 13th, 2006
0

Re: Ten minute timer ???

Click to Expand / Collapse  Quote originally posted by Dogfish ...
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.
Moderator
Reputation Points: 3278
Solved Threads: 894
Posting Sage
WaltP is offline Offline
7,738 posts
since May 2006
Dec 13th, 2006
0

Re: Ten minute timer ???

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
Reputation Points: 84
Solved Threads: 140
Posting Shark
QVeen72 is offline Offline
923 posts
since Nov 2006

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: Listboxes and scroll bars
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: How to automate some interaction between "Word" and "Access" documents?





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


Follow us on Twitter


© 2011 DaniWeb® LLC