Article ID: 169111
Article Last Modified on 12/11/1999
****Start of Code
frmTestForm = CREATEOBJECT("MyForm")
frmTestForm.SHOW
READ EVENTS
**************************************************
*-- ParentClass: basform
*-- BaseClass: form
DEFINE CLASS MyForm AS BASFORM
PROCEDURE KEYPRESS
LPARAMETERS NKEYCODE, NSHIFTALTCTRL
&& Do not comment the PROCEDURE, ENDPROC or LPARAMETERS lines
&& Comment the following two lines only
WAIT WINDOW "Form Key Press - Child Class"
DODEFAULT(NKEYCODE, NSHIFTALTCTRL)
ENDPROC
ENDDEFINE
*
*-- EndDefine: MyForm
**************************************************
*-- ParentClass: form
*-- BaseClass: form
DEFINE CLASS BasForm AS FORM
TOP = 10
LEFT = 23
DOCREATE = .T.
CAPTION = "Test Form"
KEYPREVIEW = .T.
NAME = "frmForm1"
ADD OBJECT txtTEXT1 AS TEXTBOX WITH ;
HEIGHT = 23, ;
LEFT = 84, ;
TOP = 24, ;
WIDTH = 100, ;
NAME = "txtText1"
ADD OBJECT txtTEXT2 AS TEXTBOX WITH ;
HEIGHT = 23, ;
LEFT = 84, ;
TOP = 84, ;
WIDTH = 100, ;
NAME = "txtText2"
ADD OBJECT cmdCOMMAND1 AS COMMANDBUTTON WITH ;
TOP = 216, ;
LEFT = 276, ;
HEIGHT = 27, ;
WIDTH = 84, ;
CAPTION = "Close", ;
NAME = "cmdCommand1"
ADD OBJECT lblLabel1 as LABEL with;
TOP = 20, ;
LEFT = 200,;
CAPTION = "Press the TAB key"
*!* PROCEDURE KEYPRESS
*!* LPARAMETERS NKEYCODE, NSHIFTALTCTRL
*!* WAIT WINDOW "Form Key Press - Parent Class"
*!* DODEFAULT(nkeycode, nshiftaltctrl)
*!* ENDPROC
* Uncomment the above code and comment the contents of
* the Keypress procedure (Comment the 2 lines of code that
* are identified to be commented out within the Keypress
* procedure, which are the lines that start with "WAIT WINDOW"
* and "DODEFAULT". Do not comment out the PROCEDURE line nor the
* LPARAMETERS line nor the ENDPROC line) in the BasForm
* Class definition and the error will not occur.
PROCEDURE txtTEXT1.VALID
IF EMPTY(THIS.VALUE)
WAIT WINDOW "Text1 Valid"
ENDIF
ENDPROC
PROCEDURE cmdCOMMAND1.CLICK
THISFORM.RELEASE()
CLEAR EVENTS
ENDPROC
ENDDEFINE
*
*-- EndDefine: basform
**************************************************
Keywords: kbprb kbcode KB169111