Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Neat feature about Collection Class
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00791053
Message ID:
00803087
Vues:
23
Mark & Barbara

I also have a Windows Manager Class.

In the past I always used an array to store the references to any
open windows. I updated it to a collection as soon as I got VFP8.

The class has an OpenWindow function that takes the name of the
form class to instantiate. It creates the instance, incrementing
the Name property (MyForm1, MyForm2...), stores it to the collection
and returns an object reference to the newly created form.

The in the CloseForm method on the form, I call
oApp.oWindows.CloseForm(ThisForm.Name)
Which does:
LPARAMETERS cFormName
FOR EACH oForm IN This.oWindows && oWindows is a collection

  IF oForm.Name == cFormName
    RELEASE oForm
  ENDIF

NEXT
I have subclassed it for use with toolbars, and I've added various
PEMS along the way, and I've used it since with no problems.
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform