>Hi all, can anybody tell me how can I cicle through all the controls in a form and catch an specific property's value?
>
>For example if I got 3 buttons in a form and wanna know the status of the enable property for each button. How can I do this? I've tried using the controls and controlscount properties but had not good results, think I'm missing something here.
>
>TIA
>
>Enmanuel
Controls or controlscount is not sufficient for there might be controls like pageframe, grid etc which also has pages, columns, column.controls etc.
You'd need to recursively walk into each container.
Instead of Controls collection try amembers(). Here is partial code from FoxyClasses - UDFObjCollector class.
Lparameters oContainerObject
local oObject, nMembers
local array aContainerObjects[1]
nMembers = amembers(aContainerObjects, oContainerObject,2)
With this
For ix = 1 to nMembers
oObject = eval("oContainerObject."+aContainerObjects[ix])
.WalkCollection(oObject)
oObject=.null.
Endfor
Endwith
Cetin