Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Identify a form with multiple instances
Message
De
17/07/1998 00:28:22
 
 
À
16/07/1998 22:28:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00118430
Message ID:
00118460
Vues:
26
Somehow, you already have a list of all forms: the Forms collection of the _VFP object. But I don't know if it's enough for you... probably not.

But, if you have a base form class for all your forms, than you can add a new property to this base form class. The new property will hold a reference to a custom object that stores "the other stuff" that you want to store. The custom object is good because it will group all these "other stuff" properties (several other advantages are almost obvious), but, of course you can also add these properties directly to the base form class.

The big advantage of this approach is that the Forms collection is managed by VFP automatically and you don't have to worry about updating it when the forms are created or destroyed. And it is global, so, you can access it from everywhere.

Vlad

>Let's say I fire up a form from the timer event of a timer. I can't use NAME varname LINKED because varname will go out of scope straight away. I want to use an array in a form manager class to store the form reference along with other stuff - so how do I keep the form alive and keep a unique reference to it?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform