borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Next Topic (Error message about common dialog control) New Topic New Poll Post Reply
AndreaVB Forum : VB General : Minutes only with a timer function
Poster Message
Nicholas
Level: Big Cheese

Registered: 31-08-2002
Posts: 24

icon Minutes only with a timer function

Hello. I'm messing around with the timer function and not getting results I need. I'm looking to create a timer which will tally only minutes (ie: 2 hours will show 120 minutes) I'll need a button to start and a button to stop the timer. Is there a way to do this or any code which I can tinker with? Thanks in advance, and apologies if it a very basic question but not sure how to do it.

27-05-2008 at 12:21 PM
View Profile Send Email to User Show All Posts | Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1641
icon Re: Minutes only with a timer function

The existing timer will work as it is -- just have it set to activate (to run the code in the timer's routine) every 30 seconds (a value of 30000 in the timer's properties).

You just have the  time you want increased every other timer routine access.  First access of the timer will always be 30 seconds, the next will always be a min.  Not sure how you keep track of the time otherwise.... but you could always just have:

your_time_variable = your_time_variable + .5

in the timer routine -- then just discard anything after the decimal wherever you display the time.






____________________________
Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)

27-05-2008 at 03:09 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
AndreaVB Forum : VB General : Minutes only with a timer function
Next Topic (Error message about common dialog control) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Il portale per lui e lei | Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder