Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Closing a modal form
Message
 
 
To
27/05/2023 13:24:10
Lutz Scheffler (Online)
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01686646
Message ID:
01686674
Views:
16
>>>>Sorry I am not getting it. Again, in my case - now - the popup form is MODELESS. As soon as the code in this, POPUP MODELESS form, calls .hide(), the method DEACTIVATE is fired. And therefore, the .tag is gone. That is, as soon as hide() fires, the code (in the debugger) goes to the READ EVENTS line.
>>>
>>>DEACTIVATE means the form is not active, not closed. The form only closes, when you fire something closing the form in DEACTIVATE.
>>>Try:
>>>
>>>Public poMyForm
>>>poMyForm = Createobject("myform")
>>>poMyForm.Visible = .T.
>>>
>>>Define Class myform As Form
>>>	AutoCenter = .T.
>>>	AllowOutput = .F.
>>>
>>>	Procedure Activate
>>>		?'activated'
>>>	Endproc
>>>
>>>	Procedure Deactivate
>>>		?'deactivated'
>>>	Endproc
>>>Enddefine
>>>
>>>
>>>Update: Run the code, click on _screen, click on form. (Do not click Toolbars or Menu, this is different)
>>
>>Thank you for clarifying what Deactivate method does. But somehow it does not work in my form.
>>As soon as I click on any button in the popup form, the method in this button fires. The method is simply the following:
>>
>>thisform.tag = '1'
>>thisform.hide()
>>
>>The in the Calling method, after oPopupform.show() the code should evaluate the value in the oPopupform.tag.
>>But the code never moves to the next line, after the oPopupform.show(). The code goes to READ EVENS.
>
>This is normal for a MODELESS form.
>In my example above, the code is ended in an instant. The form survives only because it is bound to a public var. Code does not wait for the form, that's the idea of modeless. It will wait for a MODAL form, in short MODAL means. Do nothing then me.
>
>To get a result from a modeless form, you must give the information to the caller. IOW, the form must active store the information, or you need eventbinding to catch the hiding of the form.

I get it. So assigning a value to the .tag of the popup form does nothing. I will see what I can do.
Thank you!
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform