Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Close application when the main window x is clicked on
Message
 
 
To
04/08/2022 14:06:15
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01684781
Message ID:
01684792
Views:
29
Actually it does not have to be. But I thought that anything called from the windows with the property ShowWindow - 2 Top, has to be modal. My mistake.

>Ok, Dmitry, I got your point.
>
>Why does the called window have to be Modal?
>
>>Antonio,
>>What you wrote makes sense. But there is one problem. The main form calls a modal form and that modal forms creates a report (in a preview mode). So, if I do not have the _screen and only the main form, the report preview will only be shown within the size of the main window/form. Therefore, in order to be able to view the report in full screen (in a preview mode), I had to go with the _screen.
>>Does it make sense?
>>
>>>Dmitry, I'm sorry to start the reply with another question, but if it's a one-form application, why is the _Screen visible in the first place?
>>>
>>>The basic architecture of the single form applications I worked with is as follows:
>>>
>>>1. In config.fpw,
>>>
>>>SCREEN=OFF
>>>
>>>2. In main.prg
>>>
>>>
>>>*
>>>* do whatever setup is needed
>>>*
>>>
>>>* launch the single form
>>>DO FORM main.scx
>>>IF TYPE("_Screen.ActiveForm") == "O"
>>>  READ EVENTS
>>>ELSE
>>>  * deal with failure
>>>ENDIF
>>>
>>>* done, VFP will exit now since it does not have anything more to do
>>>
>>>
>>>3. The main.scx has ShowWindow = 2 (Top Level form), and the code of its Destroy event, in essence, is just
>>>
>>>
>>>CLEAR EVENTS
>>>
>>>
>>>Does this make any sense to you?
>>>
>>>>Hi,
>>>>Another follow up to the question about a one-form application.
>>>>I put the CLEAR EVENTS in the Unload method of the form. It works when I release the form first.
>>>>But if, while the form is open, I click on the x (in the upper right corner; the _screen) the application wont close. I have to do it with the Task Manager.
>>>>I added ON SHUTDOWN CLEAR EVENS right before the READ EVENTS line. But it does not do anything.
>>>>My question:
>>>>1. Can I disable (gray) the X in the upper right corner of the main window (_screen)?
>>>>2. What else can I do to make the application close when user clicks on the x?
>>>>
>>>>TIA
"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