Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Custom Property,Method
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00315611
Message ID:
00315633
Vues:
20
>I used to know how to do this two yrs ago, but I totally forgot.
>
>I want to create a custom property in my form, lets call it RATE.
>
>I want to be able to set it to a value in that form programatically.
>
>Then I want to be able to call a second modal form, from the first
>form, by clicking a command button. I want that second, modal form,
>in its INIT, to access the property of the first form, and then
>display that value in a textbox of the modal form.
>
>Lets call the first form ORDER. Lets call the modal second form
>ordersupp. Ordersupp should be able to access the value of that
>RATE property in the ORDER form, display it in a text box, allow the
>user to change it, and in the QUERYUNLOAD of the second form, it should be able to stuff that changed value BACK into the property
>of the first form.
>
>Please dont ask me WHY I want to do this, or tell me that I shouldnt
>do it, or that there are 27 other BETTER ways to accomplish something
>similar. I am simply trying to remember how properties, methods etc
>work between two different forms. What I am describing must be a
>do-able thing.
>
>
>I am looking through WROX revolutionary guide to VFP oop, but havnt stumbled across what I need yet.
>
>thanks!

Hi Bill,

1. Add the some new property to both forms. (say, it would be ORDER.myNewProperty and ORDERSUPP.myProperty )

2. Add
PARAMETER myParameter
thisform.myProperty = myParameter
to ORDERSUPP.INIT()

3. Add
RETURN thisform.myProperty
to ORDERSUPP.Unload()


4. Call from somewhere in ORDER form
DO FORM ORDERSUPP WITH thisform.myNewProperty TO thisform.myNewProperty

5. Do whatever processing you need in modal form and store the result in ORDERSUPP.myProperty

6. Close the modal form

Your value will be in OrderForm.myNewProperty


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
Répondre
Fil
Voir

Click here to load this message in the networking platform