Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
No stinkin Valid
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00452154
Message ID:
00452561
Vues:
25
>I'm sorry I must be missing something. if that code is at the top of the event how does the code code below it run. There is code in the valid. I do not wish it to run when "cancel" or "close" is clicked. I hope that makes it clearer.

Copy the code into a prg, run it and see ;)

Look at the Valid code again - if LastKey() is not 27 - i.e., not a Cancel action - the Valid code runs; if it is a Cancel action, the Valid code does not run.

You did say close button, so I also should have included code to allow for the "x" button being clicked. Using this revised valid below and try it then - perhaps it's clearer, too.
Procedure Text1.Valid
     If LastKey() = 27 Or thisform.ReleaseType = 1
          ** cancel button or "x" close button clicked
          ** don't run Valid code.
          Return .T.
     Else
          ** normal Valid code
          Return !"-" $ this.Value
     EndIf
EndProc
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform