Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sometimes I want to release form other I don't
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00498494
Message ID:
00498516
Vues:
10
Lasse,

When the "X" is clicked the form's QueryUnload event is fired. In that event you can check the ReleaseType property (documented in the help file) to find out how the form was released, The QueryUnload event is early enough in the release process that a Nodefault command in it will prevent the form from being released. So your QueryUnload code might look like this;
* QueryUnload
IF YourConditionExists
   MessageBox("Yourmessage",0,"Important")
   Nodefault
   RETURN
ENDIF
* Here you would do whatever you need to do in the releasing of the form
As for disabling the "X", that can be done by making the form's Closeable property False (.F.) as in;
Thisform.Closeable = .F.
Personally, I like making the form NOT closeable when necessary rahter than trappiung the close operation and frustrating it. The latter approach can be irritating to the user as they see the X is enabled, they click it expecting the fomr to close and then they are told that the form cannot close. As a user I would ask, "If the form knew it couldn't close why did it let me click the X?"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform