>>How does one find which objects within a form which have certain properties?
>>For example If I wish to write a generic routine changing all disabled properties from .f. to .t.
>>
>>for a = 1 to (what function)
>> if (what array?).disabled = .f.
>> (what array).disabled = .t.
>> endif
>> a = a + 1
>>endfor
>>
>>How do I reference objects withn a form generically?
>>Thanks for your help
>>Spencer Fried
>>sfried3@ix.netcom.com
>
>You would recursively check controls (and containers' controls) and if they have disabled property defined and !readonly, protected etc would make them true. Sounds easy ? Well I'll try to write one to do job (since we are gonna deal only with enabled property no need to check for readonly, protected) :
>
>
>* Custom Method SetallEnabled2Disabled (as far as I know property enabled exists for all type of objects but not disabled)
>
>Function SetallEnabled2Disabled
>lparameters oContainer
>with oContainer
>for ix=1 to .controlcount
> .controls(ix).enabled = .f.
> if .controls(ix).baseclass = "Container"
> =SetAllEnabled2Disabled(.controls(ix))
> endif
>endfor
>
>
>I think this would set everything to disabled but haven't tried, wrote here. I would call it SetallEnabled2Disabled(thisform) then immediately set a control to enabled for a safeguard.
>cetin
As I said I didn't try it and forgot the closing ENDWITH.