General information
Category:
Coding, syntax & commands
Hi Darrel!
Yeah, I like it! Thanks the ideas! I used. First I didnot understand the OnReturnFromChild method, but now it's ok.
Thanx again.
BB
>>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
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only