Hi
Can anyone help me with the exact method of putting a user (programmer) defined procedure or method into a form using the NEW notation. The following code works perfectly,but how do I replace form.close() a standard method of form class with my own procedure or method which is still a method of the form (f1) and can access all form properties.
For example f1.pushbutton1.OnClick={;seeme()} where seeme is a UDF to make text1 visible (f1.text1.visible=.t.)doesn't work. It gives 'Data type mismatch. Expecting object' when the button is clicked.
This doesn't really surprise me but what is the solution?
This particular form is just an experiment to try to solve this problem and also for learning purposes.
Many Thanks
TonyR
LOCAL f1
f1=NEW FORM()
f1.left=67
f1.top=10
f1.height=25
f1.width=100
text1=NEW TEXT(f1)
f1.text='I AM A FORM'
f1.text1.text='THIS IS A FORM'
f1.text1.top=10
f1.text1.height=1
f1.text1.left=50
f1.text1.width=30
f1.text1.FontBold=.f.
f1.text1.visible=.f.
pushbutton1=NEW PUSHBUTTON(f1)
f1.pushbutton1.left=10
f1.pushbutton1.top=20
f1.pushbutton1.height=2
f1.pushbutton1.width=12
f1.pushbutton1.text='click me'
f1.pushbutton1.OnClick={;form.close()}
f1.open()
Can anyone help me with the exact method of putting a user (programmer) defined procedure or method into a form using the NEW notation. The following code works perfectly,but how do I replace form.close() a standard method of form class with my own procedure or method which is still a method of the form (f1) and can access all form properties.
For example f1.pushbutton1.OnClick={;seeme()} where seeme is a UDF to make text1 visible (f1.text1.visible=.t.)doesn't work. It gives 'Data type mismatch. Expecting object' when the button is clicked.
This doesn't really surprise me but what is the solution?
This particular form is just an experiment to try to solve this problem and also for learning purposes.
Many Thanks
TonyR
LOCAL f1
f1=NEW FORM()
f1.left=67
f1.top=10
f1.height=25
f1.width=100
text1=NEW TEXT(f1)
f1.text='I AM A FORM'
f1.text1.text='THIS IS A FORM'
f1.text1.top=10
f1.text1.height=1
f1.text1.left=50
f1.text1.width=30
f1.text1.FontBold=.f.
f1.text1.visible=.f.
pushbutton1=NEW PUSHBUTTON(f1)
f1.pushbutton1.left=10
f1.pushbutton1.top=20
f1.pushbutton1.height=2
f1.pushbutton1.width=12
f1.pushbutton1.text='click me'
f1.pushbutton1.OnClick={;form.close()}
f1.open()