>>>>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()")
I tried this:
zForm.cmd1.writemethod=("click","release thisform")
but that got me the error "function name is missing"
"Build a man a fire, and he's warm for a day.
Set a man on fire, and he's warm for the rest of his life."