Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Referencing a form from a menu - newbie question
Message
From
21/09/2004 06:58:13
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00944466
Message ID:
00944470
Views:
12
> i have a menu option with two lines of code
>
> ? wexist('gform') &&returns .t.
> gform.visible = .f. &&returns error "object gform is not found"
>
> not sure why that second line does not work if the form exists.
> how do i manipulate the form properties from within the menu?
> when i ran the form i am using "do form gform name gform"

You're right, the Name clause of Do Form is a good way to go.
Your description sounds as if the variable falls out of scope, which would be default behaviour for Local and Private / spontaneous variables in Vfp.
You can store the reference in any persistent place, like a ParentForm.Property or a public property or variable. (The latter is not really recommended)
*!* do form gform name gform
_screen.AddProperty('oGForm') && for example
do form gform name _screen.oGForm
(WEXIST() only says there is window "gform" defined.)


hth
-Stefan
Previous
Reply
Map
View

Click here to load this message in the networking platform