Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to change a property to a form from within a PRG fil
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00019515
Message ID:
00019537
Views:
38
>Hi guys,
>Is there a way to change a property of a form from within a PRG file, lets say that I call a program from
>the init method of my_form, and in that program I want to change my_form.my_property, how can I do that?
>
>I tried:
>DO FORM my_form NAME my_form LINKED
>and then in the init event of my_form:
>
>DO my_prg WITH THISFORM.name
>
>and when I try to change the property in my_prg
>
>FUNCTION my_prg
>PARAMETER form_name
>LOCAL property_name
>property_name=m.form_name+".my_property"
>STORE "Hello" to &property_name
>
>I receive the error "My_form" is not an object.
>Any suggestions?
>
>=THIS.thanks("in advance")

You can try something like this:

**********
lParameters lcFormName

OkGo = SomeObject
FOR i = 1 TO _SCREEN.FormCount
IF _SCREEN.Forms(i).Name = lcFormName
OkGo = _SCREEN.Forms(i)
EXIT
ENDIF
ENDFOR

IF OkGo <> SomeObject
OkGo.MyProperty = ...
ENDIF
***************

Ok bye!
If we exchange an apple, we both get an apple.
But if we exchange an idea, we both get 2 ideas, cool...


Gérald Santerre
Independant programmer - internet or intranet stuff - always looking for contracts big or small :)
http://www.siteintranet.qc.ca
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform