And debugging the code I notice that if I press the ESC key, <b>Thisform.keypress</b> gets it and executes thisform.QueryUnload() But if I just press the <b>Close</b> button of the toolbar, it just calls Thisform.Release, and doesn't calls QueryUnload(), etc.
Greetings Miquel,
this is standard WINDOWS behavior. There are two ways to close a form. One is QueryUnload() called when the user does something. The other is Release() called by the programmer in code. They both feed into Destroy().
QueryUnload() is triggered by using the close 'x' inthe corner, close from the popup in the upper left corner, using close from the menu, and ESC. The purpose is to prevent closing the window if something is not finished.
Always use thisform.release() in your code and all will work as expected. Enjoy. James Sayer ©2001 James Sayer |