Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 808
  • Last Modified:

Close Top Level form

I have a form that runs as a top level form.  When the app starts, the main foxpro window is hidden and my form appears and all works well.  I have a prg that is that is the main file for the project.  Before calling the form, I have ON SHUTDOWN DO MyExit.  MyExit is a prg that contains Release All, Clear Events, Quit.  On my form I have an exit button that contains Clear Events.

When clicking the exit button, all works well.  When I click the close button (red x) in the top right corner of the form, the red x now appears disabled and the form does not exit.  I would like the form to close and the application to exit via the red x or the exit button.  What am I missing?
0
wcsoctu
Asked:
wcsoctu
1 Solution
 
tusharkanvindeCommented:
On clicking the red x button, the OnQueryUnload event will be run. You can put your code in it.
0
 
wcsoctuAuthor Commented:
The form has the property QueryUnload.  I put CLEAR EVENTS in there and I get exactly what I wanted.  Thank You.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now