Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Disabling and Enabling all controls on Form
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01440952
Message ID:
01441022
Views:
69
Cecil,

I have all of my controls in a given project library with an 'objectmode' method. In their (each control's) refresh() I call their 'setmode()' fuction, which checks the 'mode' of the form, so the controls refresh thmselves accordingly. A form comes up in 'edit' mode and the controls see that, through 'thisform.mode' and make sure they are in 'edit' behavior, whatver I have defined that to be. so the default is in 'edit' and no action is needed.

For example a person with 'admin' status at login may open a form and it is automatically in 'admin' mode. The data entry controls see this and make themselves read only, whereas certain other controls, which are read only in 'edit' mode see the 'thisform.mode' = 'admin' and make themselves available for 'admin' fuctions.

You can sub-class any given situation and have as many 'modes' as you like, and have only the controls you want to respond to that mode.

Al Allison

>That is the way I was going to leave the form, so that if anything changed, the SAVE button would become enabled. I was trying to follow what the client had before, but I think you are right. I think I'll drop the SetAll() for now and leave the data vailable for changing at anytime. One client I had insisted that the data had to be unaccessible until an EDIT button was clicked on. No good argument would have changed that client's mind at that time. My client does not respond very quickly, so in trying to follow what they had before, I get a few stomach aches along the way.
>
>>ReadOnly and Disabled should have different visual appearances. ReadOnly means you can still tab through the control and you should be able to copy the text to the clipboard. You can still use SetAll() on the controls.
>
>>But.. I am curious...is using and Edit button a requirement? I've found, as have my users, that it's much easier to just allow edit. Set a flag when data changes, then prompt the user to save if they close the form or move to a different record without saving.
>
>>Look at how Word and Excel work. The data is always in edit mode.
Previous
Reply
Map
View

Click here to load this message in the networking platform