Um, exactly what I thought would happen.
Let me reiterate:
This cannot be done at run time.Which means it cannot be done in a PRG in this fashion.
The form (or class) must be up in the Form (or Class) Designer.
>here is all my code in a prg:
>zForm = CREATEOBJECT('Form')
>zForm.AddObject('cmd1','CommandButton')
>zForm.cmd1.Caption = 'Process call nbr' && Caption on the Command button
Even if it could be done at run time, this line will not work, because of the "=" .
>zForm.cmd1.writemethod=("click","thisform.release()")
Here's a design time PRG that will work:
Modify Form myform Nowait
ASelObj(lax,1)
ZForm = lax[1]
ZForm.AddObject("cmd1","commandbutton")
ZForm.cmd1.Caption = "Release thisform"
<b>ZForm.cmd1.WriteMethod("Click","Release thisform")</b>
Insanity: Doing the same thing over and over and expecting different results.