Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Read only for all fields
Message
From
08/08/2009 12:36:07
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01416802
Message ID:
01416879
Views:
79
>Can I turn all textboxes and checkboxes of my form readonly without have to specify one by one ?
>
>I need to creat a button to change they to edit and not edit mode

You can bindevent() all controls' .refresh() event to some form method, where you'd use aevents() to find the caller object, and then from it set the control's .readonly to .t. or .f. - though, not all controls, only those that have the .readonly property, and, of course, skip your navigation buttons, the edit/view button and whatever else you find that needs to be skipped. You'd need to recurse through the whole form, in case you have nested controls like grids, pageframes, containers.

That's, IMO, far easier than going down the list of all controls or all classes that you may have, and will keep working even if you add more controls later. Also, setall() doesn't recurse, so you'd have to reissue the whole set of setall() calls for each composite object.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform