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:
01450306
Views:
52
>>>>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.

I tested and the form's property value can be accessed in Init of the control. But your point regarding if the control is placed directly on the form or not is valid. Something to think about. Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform