General information
Category:
Forms & Form designer
>Hi,
>
>I have a form, with the "X" in upper right corner. When cliccing on that forms released - thats fine
>
>Some times a special condition is there, and then I want a special warning to be displayed - and then prevent releasing.
>
>If I put the messagebox() in the destroy method - it displays - but I can't figure out HOW to prevent the form from closing
>
>I know I can disable the "X" perhaps via a timer - but that does not give the message to help the user.
>
>There is no valid for that condition.
>
>In short is it possible to prevent a release of a form - like returning an F in the INIT - or Valid
>
>Thanks in advance
>
>Lasse
>
>PS: a DO Form in the destroy does actually the job - but I doubt that's a good solution
Look in the queryunload event of the form.
There you can place your messagebox code.
If you want to stop the releasing of the form then after the messageboxe is shown, you can issue nodefault which stops the form from unloading
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only