Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Iterating through form's controls
Message
 
À
22/08/2000 21:02:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00407951
Message ID:
00409164
Vues:
24
Hi Trey

This idea solved a problem I had. I often have had need to trigger a method on a series of objects. This idea basically turns the "SetAll" method into a general pupose way to call a method for a group of objects.

Thanks
Simon


>>Hi everyone,
>>
>>
>>with this.PageFrame.Page1.Container1
>>    .control1.SetDefaultState()
>>    .control2.SetDefaultState()
>>    etc.
>>endwith
>>
>>
>
>Give each of your controls' "base" class a custom property lSetDefault, and give it an Assign method. In each lsetdefault_assign method, put
>
>LPARAMETERS vNewVal
>*To do: Modify this routine for the Assign method
>THIS.lsetdefault = m.vNewVal
>IF m.vNewVal = .T.
>  this.SetDefaultState()
>ENDIF
>Then, at the form level where you want these to fire, issue this:
>
>this.SetAll("lSetDefault", .T.)
>
>Every control with an lSetDefault property will have it set. This works very fast.
Simon White
dCipher Computing
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform