>>>I am getting "property click is read only" when I attempt to programatically set a commandbuttons click method. Can this be done programatically?
>>
>>How are you trying to set it?
>>If at design time, you can use WriteMethod()
>>It cannot be done at run time.
>
>I tried this:
>zForm = CREATEOBJECT('Form')
>zForm.AddObject('cmd1','CommandButton')
>zForm.cmd1.Caption = 'Process call nbr' && Caption on the Command button
>zForm.cmd1.Click='Release thisform'
That's considered run time, so this feature not available.
Even at design time, the line
>zForm.cmd1.Click='Release thisform'
wouldn't work, because only properties can be set this way.
It
is a weird error message to get, though...
fwiw - at design time, you can get a reference to the button and use WriteMethod(), e.g.
** hover mouse cursor over the button then
ox = SYS(1270)
ox.WriteMethod("Click","thisform.Release()")
Insanity: Doing the same thing over and over and expecting different results.