Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling method from parent form
Message
 
To
09/09/1999 11:55:58
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00262927
Message ID:
00262938
Views:
15
>I have a method I would like to call from a parent form.
>
>ie: FORM1 (parent: has method TheMethod())
> Press cmd_btn triggers modal FORM2 (child)
> Press cmd_btn on modal FORM2 and call method FORM1.TheMethod
>
>Usually I would say THISFORM.TheMethod() from within the parent form I thought I could just call the method from the child form by FORM1.TheMethod().
>
>How would I do this?
>
>TIA
>
>/Chris

When I want to access methods and properties from a parent form I would pass the reference to the parent to the child form as a prameter. Such as DO CHILDFORM WITH THIS

The parameter would be received in the init method of the child and stored in a property of the child form. Thus when you need to access a property or method of the parent you would just reference it through a property of the child form. E.G. THISCHILDFORM.PARENTOBJECTPROPERTY.METHODYOUWANTTOCALL

Hope this helps
Bret Hobbs

"We'd have been called juvenile delinquents only our neighborhood couldn't afford a sociologist." Bob Hope
Previous
Reply
Map
View

Click here to load this message in the networking platform