Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Count down timer ?
Message
From
22/08/2002 15:27:55
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00692538
Message ID:
00692631
Views:
26
>Does anyone have code or know of an easy way to display a count down timer on a VFP7 form? I need to code tests that are timed and have the program stop the user when the time is up. That is the easy part, but I need to show the user taking the test how much time remains before the test is done. I don't want to take the time to reinvent the wheel if someone has already done it. Thanks for any help on this!
>Colombo.

Use the Timer object.
* Form.Init():
ThisForm.nCountDown = 1000

* Timer.Interval = 1000 && Miliseconds

* Timer.Timer():

ThisForm.nCountDown = ThisForm.nCountDown - 1
ThisForm.LblShowCountDown.Caption = trans(ThisForm.nCountDown)
if ThisForm.nCountDown <= 0
  * Whatever you want to do when countdown finishes
endif
HTH, Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform