oForm = CREATEOBJECT([form1]) oForm.Show(1) ************************************************** *-- Form: form1 (d:\all_zapl_4_9_0\testme.scx) *-- ParentClass: form *-- BaseClass: form *-- Time Stamp: 03/28/07 09:06:10 PM * DEFINE CLASS form1 AS form Top = 0 Left = 0 Height = 617 Width = 719 DoCreate = .T. Caption = "Form1" KeyPreview = .T. Name = "Form1" ADD OBJECT command1 AS commandbutton WITH ; Top = 437, ; Left = 368, ; Height = 27, ; Width = 280, ; Caption = "Clickme or Press ESC", ; Name = "Command1" PROCEDURE QueryUnload MessageBox([You are right Naomi. It does fire!]) ENDPROC PROCEDURE KeyPress LPARAMETERS nKeyCode, nShiftAltCtrl IF nKeyCode == 27 thisform.Release() ENDIF ENDPROC PROCEDURE command1.Click thisform.Release() ENDPROC ENDDEFINE * *-- EndDefine: form1 **************************************************