Article ID: 130834
Article Last Modified on 2/15/2000
Thisform.mymethod(this)
-or-
Thisform.mymethodIn the following example code, a form is created, and the ChangeCaption method of the form is called. Controls are passed as parameters. This example could have been programmed differently by making the ChangeCaption a method of any control. It is included to illustrate how object type variables are passed as parameters.
PUBLIC oForm
oForm=CREATEOBJECT('Myform')
oForm.show
=MESSAGEBOX('Note the Caption of the CommandButton')
oForm.ChangeCaption(oform.mycmd)
=MESSAGEBOX('Note the Caption of the CommandButton')
DEFINE CLASS myform as FORM
ADD OBJECT mycmd as COMMANDBUTTON with Caption = "Before"
ADD OBJECT cmdquit1 as cmdquit
PROCEDURE ChangeCaption
PARAMETER objref
objref.Caption="After"
ENDPROC
ENDDEFINE
DEFINE CLASS cmdquit as COMMANDBUTTON
Caption= "Quit"
Top=25
Left=25
PROCEDURE Click
RELEASE Thisform
ENDPROC
ENDDEFINE
Additional query words: VFoxWin
Keywords: kbcode KB130834