DEFINE CLASS ctestescform AS form Top = 0 Left = 0 Height = 75 Width = 375 DoCreate = .T. Caption = "Escape Key Sample" KeyPreview = .T. Name = "frmEscKeyTest" ADD OBJECT txttest1 AS textbox WITH ; Value = "Some Text", ; Height = 23, ; Left = 24, ; Top = 12, ; Width = 100, ; Name = "txtTest1" ADD OBJECT txttest2 AS textbox WITH ; Value = "Some Text", ; Height = 23, ; Left = 24, ; Top = 36, ; Width = 100, ; Name = "txtTest2" PROCEDURE KeyPress(nKeyCode, nShiftAltCtrl) IF nKeyCode = 27 AND nShiftAltCtrl = 0 NODEFAULT && This disables default behavior WITH this .WriteBuffer() IF .QueryUnload() .Release() ENDIF ENDWITH ELSE RETURN DODEFAULT(nKeyCode, nShiftAltCtrl) ENDIF ENDPROC PROCEDURE WriteBuffer() *-- Put code to force control's value to it's controlsource here ENDPROC PROCEDURE QueryUnload() *-- Put code to determine if changes made here ENDPROC ENDDEFINE>I tried that. It seems that the default escape behavior is taking place before my code. When Escape is pressed, the first thing that happens is the text dissappears, then my KeyPress event code fires.