Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I disable fields on a Pageframe
Message
 
To
31/05/2002 15:13:39
Charlie Schreiner
Myers and Stauffer Consulting
Topeka, Kansas, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00663496
Message ID:
00663739
Views:
18
I agree the best solution is to have a plan before coding starts. In our case we had to devise a security system for 8 existing projects with numerous classes, forms etc. The goal was to be able to control every object to 3 possible options (R/W, R-Only, Invisible). We found that simply putting a unique ID in the Tag property, we were able to control everything through a security database. Simply by adding a call in the init of every form, all controls are set according to the individual rights assigned. It actually was very easy to accomplish and kind of spooky how fast and good it works. The administrator of security can simply make the settings from his workstation and the individual users rights are changed right away. Very flexible for the man hours put into the task. The only difficulty we had was on containers to devise code to drill down to all objects in the container. Existing applications had containers that added containers (up to 5 deep).



]>Hi Doug,
>Of course that method works but why not use, what seems to me, a more OOP approach. The controls, TextBoxes, ComboBoxes, etc., that you have on your form could be based on classes that 'know' how to behave. Perhaps you could have a Form property, or a Business object property that indicates if the controls should be Enabled. When you Refresh(), the form's controls all show the right data and are enabled and disabled appropriately.
>No one ever seems to say, "I want my txtName control to show the Customer name. How should I set the Value?" People know that they set the ControlSource and that Refresh() magically sets the control's Value and shows the data. Other control attributes should be the same. Just make some classes that do what you want--refresh the form--it should look right. Worming through the controls just means you are resorting to a quick and dirty fix for objects that don't know how to behave. Just my opinion.
>
>>Works like a charm! I'll try not to feel too stupid the rest of the day...I have never used SetAll and tried it on the form as a whole - didn't think about doing it on a class by class basis.
>>
>>Thanks again,
>>Doug
Previous
Reply
Map
View

Click here to load this message in the networking platform