Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Real Basic Question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00294983
Message ID:
00294992
Vues:
17
>What is the proper way to verify if a user wants to quit an application? I have the following in my Destroy event, but I don't know what to do if they answer 'No'.
>
>TIA
>
>Answer=MessageBox("Are you sure you want to quit?",276,"Quit?")
>Do Case
>	Case Answer=6 && Yes
>		Close Tables all
>		Close DataBases All
>		Clear Events
>	Case Answer=7 && No
>		(What do I do here?)
>EndCase
>
Hi Alan,

I wouldn't put it in the Destroy. I have a method, ExitForm, in my form base class that I put code like this. I call it from any place the user can exit the form and/or the QueryUnload event. I return .T. if the user chooses to exit, .F. if not and take the appropriate action. E.g. if fired in the Queryunload, if the user says no, then I issue NODEFAULT in the Queryunload and return .F. There are probably plenty of other schemes in use, but this has worked well for me.

Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform