Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Modeless form disappears due to scope
Message
De
10/10/2011 16:16:59
 
 
À
10/10/2011 11:20:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01525979
Message ID:
01525994
Vues:
62
>I have a question about how to keep a modeless form around after the variable it was created with loses scope.
>
>My code looks something like this:
loForm = Newobject('SomeFormClass', 'SomeLib.VCX')
>loForm.SomeProperty = .T.
>loForm.Show()
>Since the form is modeless, when the method which creates it completes, loForm goes out of scope, and my form closes. (I see it flash briefly).
>
>What's the normal way to code this so that the form hangs around?
>
>Oh, two more things
>
>(1) This method may be called more than once, so there may be multiple instances of the form running.
>(2) This is not part of an application, but runs in the IDE, so I can't have a forms manager around to do this for me.
>
>Thanks in advance,
>
>
>Jim

You can use the _screen object as a holder for global properties.
_screen.addproperty("iform")
_screen.iForm = creatobject("myformclass")
_screen.iForm.show()
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform