Article ID: 138921
Article Last Modified on 2/11/2000
* The following example uses DEFINE CLASS and CREATEOBJECT()
* to create two custom classes named FormChild and FormGrandChild from
* the Visual FoxPro Form base class. ACLASS() is used to create an
* array named gaNewarray containing the class names, which is
* then displayed.
CLEAR
PUBLIC frmMyForm
frmMyForm = CREATEOBJECT("FormGrandChild")
frmMyForm.visible=.t.
* frmMyForm.show && uncomment this for proper behavior
WAIT WINDOW 'After calling the form' TIMEOUT 2
DEFINE CLASS FormChild AS FORM
ENDDEFINE
DEFINE CLASS FormGrandChild AS FormChild
Caption='Hi'
Left = 10
Top = 10
Height = 54
Width = 99
WindowType = 1 && modal
PROCEDURE Init
THIS.AddObject("Cmd1", "MyCmdBtn")
this.cmd1.left = (thisform.width - this.width) /2
this.cmd1.top = (thisform.height - this.height) /2
this.cmd1.visible = .t.
ENDPROC
ENDDEFINE
DEFINE CLASS MyCmdBtn AS CommandButton
Caption='Bye' && Caption on the Command button
Left = 10 && Command button column
Top = 10 && Command button row
Height = 18 && Command button height
Width = 60 && Command button height
PROCEDURE Click
THISFORM.Release
CLEAR EVENTS
ENDPROC
ENDDEFINE
Keywords: kbprogramming kbprb KB138921