Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Program to close all forms
Message
 
À
14/04/2000 08:45:24
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00359746
Message ID:
00359752
Vues:
16
>I am trying to run a program to close all forms on the screen. However, the following code closes all but the last form.
>
>***
>FOR EACH oform IN _screen.forms
> oform.RELEASE()
>ENDFOR
>***
>
>How can I get all the opened forms to close?
>
>Thanks,
>
Jerryt,

You need to do it backwards through the collection. If the forms use the QueryUnload method to check to make sure the form can release, you'd need to check the results of that as well:
lnforms = _SCREEN.FormCount
lldone = .T.
DO WHILE lnforms > 0 AND lldone
  lldone = _SCREEN.Form(lnforms).QueryUnload()
  IF lldone
    _SCREEN.Form(lnforms).Release
    lnforms = lnforms - 1
  ENDIF
ENDDO
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform