Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where do I enable/disable
Message
 
To
20/08/1998 13:08:30
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00128401
Message ID:
00128697
Views:
52
John,
you're right the old days were harder, your help is much appreciated as always
Regards
Pete Kane

>Hi Peter ---
>
>>your last suggestion ( customised controls ) is exactly what I want to do, as all my forms will use these base controls/classes, I just need some help as to where to put the code, initially I put it in the Init of each class but as the Forms' mode property is set/reset by a parameter passed to the form, this was no good as the controls are instantiated before the forms inits' fired
>>I'm sure the old days were easier!?
>
>
>Haha...the old days were harder. At least now you have a somewhat consistant OOP paradigm...I remember going nuts trying to debug someone's 2.6 code where the guy was storing procs in snippets, menu code, PRGs, et al...anyway on to the business at hand:
>
>Try putting the enabled/disable check in the Refresh() event of each control...let each control check and modify it's own state (this is known as encapusulating behaviour). In the Form's Init, you can do a THISFORM.Refresh() to make sure they start out the way you want them. Your code in the Refresh of each control can be:
>
>*** Control.Refresh() method
>THIS.Enabled=IIF(THISFORM.Mode="VIEW",.T.,.F.)
>
>That's all there is to it!
Regards,
Peter J. Kane



Pete
Previous
Reply
Map
View

Click here to load this message in the networking platform