Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to set property of controls in INIT of the form?
Message
From
22/02/2010 14:26:58
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01450293
Message ID:
01450304
Views:
83
>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.

Dmitry,

Your test shows or demonstrates the normal behaviour

A couple of possibilities

(1) Change the properties of the controls you want in the form's init. I do not see a problem there

(2) You could make some classes of controls to look at form properties, ie Adding properties to the form in the form's load(), then each of those controls could find out whether a certain property exists and use it in its init

(3) BindEvent the init of the controls (post flag of bindevent) to a form's method, ie
Change each control control class to bindEvent itself in the init to a form's method (not tested)
Then in the form's method you can find out what control it is and act accordingly
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform