Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calling all controls
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00143917
Message ID:
00143944
Vues:
30
>>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform