nResponse=MESSAGEBOX('Do you want to quit this application?',4+32,'Confirm action') IF nResponse=6 THISFORM.Release() Endif * In form's Destroy method put it CLEAR EVENTS