James,
Thanks for your reply and suggestion.
I am thinking that I should place this in the button init class:
commandbutton init()
if type("thisform.ldisablebuttons") = "L"
bindevent(thisform,"ldisablebuttons",this,runeventcode,1)
endif
But where do I place this:
procedure runeventcode()
this.enabled = not thisform.ldisablebuttons
endproc
I am using the forms designer but I am unsure where the last section goes as I don't seem to be able to create a custom method in the button class. I guess I am not too good with OOP.
BTW, will this turn ALL buttons off then ALL buttons on. This maybe not what i want as some buttons will be enabled and others disabled in the calling form. I was thinking of looping through all buttons to get their state, saving them into an array, then restoring the state on closure of the called form.
What do you think?
Rex
>Rex,
>
>You can use bindevent()
>
>
>* not tested.
>commandbutton init()
>if type("thisform.ldisablebuttons") = "L"
>bindevent(thisform,"ldisablebuttons",this,runeventcode,1)
>endif
>
>procedure runeventcode()
> this.enabled = not thisform.ldisablebuttons
>endproc
>
>
>
>then all you have to do is set ldisablebuttons = .t. when calling the form and then .f. when called form is closed.
>
>>Regards...Rex
Rex Toomey
ISD Port Macquarie NSW
Australia
'Inside every older person is a younger person wondering what happened.'