Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Command button double click
Message
De
31/07/2006 23:34:27
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01141975
Message ID:
01142007
Vues:
9
>How can you keep a user from clicking the same command button more than once. They do a double click and spawn the click event twice.

I think training the users, as explained in my other message, would be the best solution.

The other alternative, a little more complicated, would be to set a form property (or a property for the button) in the button Click() Event, indicating at what moment the button was clicked. When the button is clicked a second time, the Click() Event compares this property, to see how much time has elapsed. If too little time has elapsed, nothing is done. Something like this:
* Button.Init()
This.AddProperty("tStartTime", datetime())

* Button Click()
if datetime() - This.tStartTime < 0.5 && half a second
  ?? chr(7) && Alert user
  return && do nothing
endif
This.tStartTime = datetime()
* Do the button's job here
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
Répondre
Fil
Voir

Click here to load this message in the networking platform