Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Holding the name of a control as a string?
Message
De
05/03/2002 16:01:31
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00628023
Message ID:
00628654
Vues:
25
Chris,

How about putting the validation code in the queryUnload() of the form? From your treeView, you would do something like:
if oCurrentForm.queryUnload()
    oCurrentForm.release()
    * now you can launch the new form
endif
In the queryUnload():
if (changesHaveNotBeenSaved)
    * prompt the user, or whatever you want to do
    nodefault   && prevents form from closing
endif
This also prevents a user from using the close button (the 'X') on the form if the data validation does not pass.

One more thought...I think it is usually better to allow the users to have more than one form open at a time. They may be editing something on one form, and get interupted and need to look up something else on a another form.

>Yep that's the idea - they can flick about opening one form after another (when each form opens I store away it's name and when another form is launched I first programmatically close the previous form...) the idea is that in the lost focus I detect any changes made and trap the user on the form.
Steve Gibson
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform