Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Iterating through form's controls
Message
 
To
22/08/2000 21:02:00
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00407951
Message ID:
00409164
Views:
23
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform