Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form not releasing properly
Message
De
01/05/2006 14:42:27
Alan Harris-Reid
Baseline Data Services
Devon, Royaume Uni
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Form not releasing properly
Divers
Thread ID:
01118130
Message ID:
01118130
Vues:
42
Using VFP8, I have a class-based form which I launch using the following code.
loForm = CREATEOBJECT('MyFormClass')

IF VARTYPE(loForm)='O'
   WITH loForm
      * Set some properties here
   
      .Show()         && displays form 
   ENDWITH
ENDIF
The form contains a method which should close the form using thisform.release. The release method fires but the form does not close, and the trace window still shows the .Show() line as the currently executing line. Is there something wrong with my code?

I was thinking that the form is not releasing because the object reference loForm is still in scope, but if I close the window via the close X, thisform.QueryUnload() fires, followed by .Destroy(), the form closes fine and execution proceeds to the ENDWITH command and onwards.

How can I get past the .Show() line when I close the form using thisform.release? I have put 'this.destroy' in the form release method and although it works, it is a kludge which I am not happy with.

Any help would be appreciated.

Alan
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform