Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Count down timer ?
Message
De
22/08/2002 15:27:55
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00692538
Message ID:
00692631
Vues:
25
>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)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform