Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best practice to enable/disable controls when editing
Message
From
22/01/2006 09:07:59
 
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01089195
Message ID:
01089202
Views:
21
Very well, Glenn.

Thanks.
I owe you 0.02

>If it were me, I would add a property to my control classes called lAutoEnable. Then I would write a method to drill through all controls and set the enabled property as required for those controls which are identified as lAutoEnable. My reason for this is that the refresh method does far more than spin through the controls but also refreshes the controlsource/datasources. You should only need refresh for data changes. This method could even utilize a custom form collection property which on first invocation creates the collection and populates it with object references, so subsequent calls only need to spin through the collection.
>
>My $0.02
>
>Glenn
>
>>Hi,
>>
>>Just a question about how to enable/disable controls on the form when .Thisform.lEditing is On/Off.
>>
>>When editing records, I set Thisform.lEditing to TRUE and I use to call Thisform.Refresh() method because every textbox and other controls checks for that form's property in order to set their own "Enabled" property to TRUE or FALSE in their own Refresh method.
>>Is this a good OOP practice? My textboxes and form belong to a class library.
>>
>>Or should I call a method like "Thisform.EnableDisable" to navigate all controls and set their "Enabled" property.?
>>
>>Thanks
>>Juan C.
Previous
Reply
Map
View

Click here to load this message in the networking platform