Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Createobject() and returning a parameter
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00047277
Message ID:
00047941
Vues:
28
>Hi Darrel!
>
>'Till now, I didnot use/know the queryunload event. I tried it and works fine.
>
>Secondly, Yes I also thougth about returning value from a modelles form. Would you write something about it? As I concluded, the biggest problem to decide the time, when comes the value back. So I dont use it.
>
>BB
>

Hi Bela,

This technique is designed to allow you to return a value from a modeless form when the modeless form is closed. It could be modified to return a value from the modeless form anytime the value on the modeless form is changed.

ParentForm.frx

PROCEDURE LaunchChild
DO FORM ChildForm WITH thisform && Pass reference to parent form to child form
ENDPROC

PROCEDURE OnReturnFromChild(toChildForm)
thisform.nRetVal = toChildForm.nRetVal && Get return value from ChildForm and store in parent form
ENDPROC

ChildForm.frx

PROCEDURE Init(toParent)
thisform.oParent = toParent && Receive reference to parent form and save if for later use
ENDPROC

PROCEDURE Destroy()
thisform.oParent.OnReturnFromChild(this) && Before closing childform, allow parent form chance to query return value.
ENDPROC

If you are wondering why I want a modeless form to return a value, I use it instead of a modal form, where I want to implement modality with respect to the parent form but want to still allow users to launch other unrelated forms. Try adding, thisform.Enabled = .f. in LaunchChildForm() and thisform.Enabled = .t. in OnReturnFromChild(). This will give you the benefits of a modal form by preventing access to the parent form whilst the child form is visible, without preventing your user from launching other unrelated screens.

Have fun!
Darrel
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform