Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Execute code before closing form
Message
 
À
28/03/2007 13:47:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
01209324
Message ID:
01209327
Vues:
20
>Hi all,
>
>Before exiting a VFP form, I need some code to execute, to update certain parameters through the command 'thisform.cmdUpdate.click'. Could anyone tell me how this is triggered a VFP form? (Which event, and how)
>
>Thanks in advance.
>
>Regards,
>
>Steve

Why not put that code in separate method of the form and call it from Click event of that button?
i.e. Make a new method in that form name it BeforeExit, add a property in that form and call it BeforeExitIsExecuted

In Click event of that button:
thisform.BeforeExit()
thisform.Release()


**** or if you want to call that method no matter if the button is pressed or not put in Destroy event of the form:
thisform.BeforeExit()


*** in BeforeExit method:
IF NOT thisform.BeforeExitIsExecuted
   *** do your code here
   thisform.BeforeExitIsExecuted = .t.
ENDIF
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform