Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling all controls
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00143917
Message ID:
00143944
Views:
29
>>Try This
>>
>>For i=1 to thisform.controlcount
>> thisform.controls(i).dowhatever
>>Endfor
>
>I like that idea. Then I can put an IF in the loop to exclude ones I don't want.

However, this code doesn't drill down into containers. For that, I use this:

********************************************************
* calls a method of each of a container's objects
* returns immediately if any return .F.
*
procedure ForEach(tcnt, tcMethod)

local lctrl
for each lctrl in tcnt.Controls
if PEMStatus(lctrl, tcMethod, 5)
if !lctrl.&tcMethod.()
return .F.
endif
endif
if lctrl.BaseClass == "Container"
if !ForEach(lctrl, tcMethod)
return .F.
endif
endif
endfor

return .T.

This calls a method, but you can adapt it to set properties.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform