Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detecting if a form is running
Message
 
 
To
01/12/2000 11:53:40
Josh Fedke
National Financial Corporation
Milwaukee, Wisconsin, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00448132
Message ID:
00448590
Views:
8
One thing I recommend is to instantiate your forms with different names (set in the name property... even if you multi-instance the same modeless form).

You can use the following snippet to get at the form you want based on its name property (which is also its window name as used by the WExist() function).


Function ReturnFormRef(cWindowName)
Priv frm
for each frm in _Screen.Forms
if upper(cWindowName) == Upper(Trim(frm.name))
Return frm
Endif
Endfor
Return .F.


Note that by using FOR EACH to get a reference to each form, you can sniff (or modify) the properties of each form as you iterate through them, thus enabling you to use properties of your forms to determine if a given form is of interest to you.


>I'm trying to detect if a toplevel, modeless form is running. I'm trying something like:
>
> if type("test_form.width") = "U" &&it will be "U" if form isn't running
> do form test_form
> endif
>
> The type is always "U", even when the form is running. I have considered using amembers(...), but if the form isn't running, amembers(...) throws an error.
>
>
> Anyone have any other ideas/corrections? Thanks in advance.
Previous
Reply
Map
View

Click here to load this message in the networking platform