Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Datasessions - thisform.release
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00090329
Message ID:
00091516
Vues:
28
>>>>>This code is OK, but the form itself is not able to release itself because of the variables or properties may hold references like
>>>>>
>>>>>myVar1 = thisform.grdGrid1
>>>>>myVar2 = this
>>>>>thisform.oGrid = thisform.pgfPageFrame.Page2.grdCustomers
>
>...snip
>
>Thanks for your replies. Decided to debug some more areas and in the process the problem resolved itself. Still got away to go to feel really confident here methinks!
>
>Question re the text above. Where should I create myVar1 if I want it to be private to a form? In the init code? This could be good for references to grids on page frames and the like. Gives me a way of extending the "This" and "Thisform" concept?!
>
>Thanks again - Sarah

If you want to make it private to the form you need to add the property say, oGridCustomers to the form. Then in form.Init() you may assign your grid to it:
thisform.oGridCustomers = thisform.pgfPageFrame1.Page2.grdCustomers
and then anywhere in code you may for example set and reset grid properties like:
WITH thisform.oGridCustomers
   .RecordSource = "customers"
   .Column1.ControlSource = "customers.firstname"
   .Column2.ControlSource = "customers.lastname"
   .Column3.ControlSource = "customers.address"
*** more code here***
ENDWITH
Don't forget to reset thisform.oGridCustomers to .NULL. in form.Destroy()
You can also assign your objects to the properties in application object, or create special "exchange object", so your forms can communicate through it.

Nick
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform