Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Methods of a different form
Message
De
04/03/1998 17:40:35
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00082558
Message ID:
00082587
Vues:
30
>>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform