Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Command button Not Enabled but still hears click?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00172199
Message ID:
00172251
Vues:
26
Hi Vern..

I think the issue relates to queued-up events. Regardless of whether the CommandButton Object is enabled - clicking the mousebutton does indeed generate a windows event. By the time the CommandButton gets enabled again,the second click can be processed. Here is one example of click method code that does fix the problem:

This.Enabled = .F.
for x = 1 to 200
If Mod(x,10) = 0
DoEvents
Endif
Acti screen
?x
Next x
This.Enabled = .T.

The call to DoEvents allows for queued-up click events to be processed. Because the process while the enabled property is set to .F., nothing happens. You will want to use DoEvents sparingly as it will degrade performance quite a bit.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform