Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Closing a modal form
Message
From
27/05/2023 08:37:31
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:
01686650
Views:
38
>>>Hi,
>>>
>>>Can you programmatically close a modal form when a user clicks anywhere outside the form?
>>>
>>>TIA
>>
>>Try the question the other way around. Is there any event that fires if you click outside a modal form? Try SET EVENTTRACKING and the stuff around. If you see an event firing you might use this, if not, then not.
>>
>>Note, clicking outside means clicking outside the form inside VFP as well was as outside, what is different.
>
>I have never done eventtracking. So, this is another thing to learn and expose the app to possible errors. If I cannot programatically close the form, I will have to give the customer a Cancel or Close button.
>Thank you.

It's a simple command. Just for testing, create a numb modal form, place eventtracking commands in it's init, you might see it in debuggers debugoutput or send to file
Close eventtracking in the forms destroy.
While the form is open, click outside on several areas. Close the form with the usual ways to close a form.
Now inspect the file / debugoutput

You might raise the eventtracking from debugger too, if you do so do not include the MouseMove event, it's like hell

I prefer ok/cancel buttons over of the new style just-close approach, because its more clear - and I can cancel out.

You can always close a form over the items on top bar, or catch ESC or the like.
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform