Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Modeless form disappears due to scope
Message
 
 
To
10/10/2011 11:20:47
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01525979
Message ID:
01525980
Views:
97
This message has been marked as the solution to the initial question of the thread.
>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 add a reference to the form to _screen which will be used as 'Form Manager'
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform