Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP60- Close Button
Message
 
À
12/09/2000 09:59:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00415363
Message ID:
00415377
Vues:
18
>I always disable the close option (Upper Right Corner) in my applications and put an exit button on the form so the user can finish the session.
>
>This time I want to use the close button and display a simple messagebox so the user can confirm the exit of the program. If I put the code in the Destroy or Unload event of the form it's too late to go back in case the user doesn't want to exit the form. How do I control the Close Button? Where do I put the code? I know I am missing something here but don't know what.
>
>Thank you in advance.


Hello,

If you mean the close button of the form then use the queryunload event like Cetin said.
If you return .f. there the unload will stop.
If you mean the close button of the main vfp screen then you can do this.
Set
On Shutdown do OnShutdown
in your main program.
In that procedure you can set the code to display a messagebox or so.
There you can place somethig like
Function OnShutDown()
If IDYES = MessageBox(......)
   Clear Events
EndIf
EndFunc
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform