General information
Category:
Coding, syntax & commands
Hi Darrel!
Your solution is great! But I have 2 additional question:
If the window is closeable and user clicks on the window close icon, in the next row, after the oForm.Show(), oForm is no longer exist, so I can decide which way was the form leaved by the user.(if type("oForm")="U" ...) Is It right?
Is there any way, with I can decide - inside the formclass - whether the code is launched by Createobject or Do Form? Because what happens when the form is launched by Do form, and I issue only the hide() method. I think that in these cases I have to issue release() in the OK/Cancel click event?
if
Thisform.release()
else
Thisform.hide()
endif
TIA
BB
>>Can someone tell me, the correct way to return a value from a modal form, if the form was launched by the Createobject() command?
>>
>>Now, I give in a parameter the name of the variable, in which I want to get back the return value. I am cuoriuos, if there is a better way.
>
>oForm = CREATEOBJECT("MyForm")
>oForm.Show()
>
>In your modal form store the value you wish to return in a property of the form. In the OK/Cancel or Close button on the modal form, use thisform.Hide() to close the form. Once the form is hidden, the next line after the show is executed and you can retrieve the value from the form as the form still exists.
>
>nRetVal = oForm.nRetVal
>oForm.Release()
>
>
>Hope this helps.
>Darrel
Previous
Next
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