Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checking for conditions in INIT
Message
De
12/11/1999 20:03:28
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00290528
Message ID:
00290844
Vues:
25
>>>What is the best way to close a form in INIT of form if a condition does not exist. My concerns are making sure that everything is released properly. My siuation is that I have a third party active-x control, in the init of the form I need to run a method of active-x and if returns .f. not allow form to open. I want to make sure nothing is left dangling !
>>
>>Try RETURN .F. from the init method.
>
>Thanks for reply however, I think any object other than a form, returning .f. in init would be fine. I think though that objects contained on form would not be released or they would be left dangling by just returning .f. in INIT of form. I guess I can release or destroy the form. I'll just have to research further.

Working with Active-X it's often safer to start/kill them from Form.Activate event. Create some form property-flag 'firstacivateflag', set it to .T. in Form.Init event, and in Form.Activate:
If This.Firstactivateflag=.t.
 This.Firstactivateflag=.f.
 *** do all manipulations here, or even close the form
Endif
Edward Pikman
Independent Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform