Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Referencing a class in a form from another class
Message
De
06/08/1997 16:26:04
Edward Crawford
City Facilities Management
Glasgow, Royaume Uni
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Referencing a class in a form from another class
Divers
Thread ID:
00043412
Message ID:
00043412
Vues:
68
I have a class that is made up of a container and some labels. We will call it Example1.

I instantiate this class with oExample1 = CREATEOBJECT("example1") at the beginning of my program. I then run a form with DO FORM. In the ini() method of the form, I ADDOBJECT("oExample1", "example1") this container class to the form.

While the program is running, a timer object fires a method in another class that was also instantiated at the beginning of the program with oExample2 = CREATEOBJECT("Example2"). While this method is running, it updates the captions in the first class with oExample1.lblLabel.Caption = Testing". This update is not reflected in the Example1 class.

My thought is that I have create two separate instances of Example1, so changeing the labels in oExample does not effect frmForm.oExample. If this is true, how do I go about writing to the object in the form from outside the form. I have tried _SCREEN.frmForm.oExample, frmForm.oExample, and _VFP.frmForm.oExample to no avail. The other question would be, am I going about this the wrong way?

Thanks Ed
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform