Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to set property of controls in INIT of the form?
Message
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01450293
Message ID:
01450302
Views:
56
>>>I want to find a way to change value of a property on a bunch of controls on a form from the INIT method of the form. This way, when each control's INIT fires, the value of the property is already set. But when ran a little test I see that the INIT of controls fires first and then the INIT of the form. Any suggestions? TIA.
>>
>>Init of the forms' controls fires before the Init of the form (from the inner most to the top most container). The only way to fire Init of the control after the Init of the form would be by adding this control in run-time in form's Init.
>>
>>In order to set some property of many objects you can use SetAll method of the form.
>
>I think I might have found the solution. I can set a property of the form in LOAD method to some token value. Then each control in it's INIT method can check for the parent property value. Hopefully I won't create a maintenance nightmare :).

I'm not sure you can access parent from the Init of the control. Also, the control may not be directly placed on a form.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform