Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Methods of a different form
Message
From
04/03/1998 17:40:35
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00082558
Message ID:
00082587
Views:
34
>>>I was wondering if I can access from Form1 the methods and events of Form2 without using a Formset and how?. Form1 and Form2 are two forms independent from one another.

>>The most reliable method is to check _SCREEN.Forms() collection and then make a reference:
>>_SCREEN.Forms(x).Mymethod()

Another approach is based on the following strategy - design forms in class libraries and instantiate them as objects.

LOCAL loForm1, loForm2

loForm1 = CreateObject("MyFirstForm")
loForm2 = CreateObject("MySecondForm", loForm1)

Now, assuming that loForm1 is stored as an property of loForm2, any public property of loForm1 can be accessed by loForm2. For its additional flexibility, I no longer use .scx files at all.
David M. Stowell
Ravenslake Consulting
Chicago, Illinois

e-mail: davidstowell@ravenslakeconsulting.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform