>PUBLIC oMyform >oMyform=NEWOBJECT("form1") >oMyform.Show >RETURN > >DEFINE CLASS form1 AS form > > ADD OBJECT text1 AS textbox WITH ; > Left = 10, ; > Top = 10, ; > Width = 100 > > ADD OBJECT cmdCancel AS commandbutton WITH ; > Top = 10, ; > Left = 256, ; > Height = 24, ; > Caption = "Cancel",; > Cancel = .T. > > PROCEDURE text1.Valid > DEBUGOUT thisform.ReleaseType > RETURN !EMPTY(this.value) > ENDPROC > > PROCEDURE text1.ErrorMessage > DEBUGOUT thisform.ReleaseType,LASTKEY() > IF thisform.ReleaseType > 0 OR LASTKEY()=27 > thisform.Release() > endif > ENDPROC > > PROCEDURE cmdCancel.Click > thisform.Release() > ENDPROC > >ENDDEFINE >