Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to bypass Valid event
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00846883
Message ID:
00846942
Vues:
25
Checking lastkey() as suggested by David will fail if lastkey has already been 27 before taking action and the user leaves the textbox by clicking on another control other than the Canc button since a mouse click does not change the lastkey value.

Creating a property lCloseNoValid as suggested by Michel is not necessary since ReleaseType will do the job.

Solution suggested by John in FAQ #7765 might be a bit complicated.

Please try the following:
Do Case
Case !Wontop(Thisform.Name)  && Activating another form. No validation
  Return .T.
Case Thisform.ReleaseType>0  && Quiting VFP or clicking on form's close box. No validation
  Return .T.
Otherwise
  oObj=Sys(1270)
  If Vartype(oObj)='O' And oObj.Name='cmdCanc'  && Clicking on the Cancel button. No validation
    Return .T.
  Endif
Endcase
... validation code goes here...
Ben
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform