Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Read only for all fields
Message
 
 
To
08/08/2009 12:36:07
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01416802
Message ID:
01416908
Views:
86
>>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.

Dragan,

SetAll is recursive, e.g. thisform.SetAll('readonly', .t.,'textbox') will change status of all textboxes no matter how deep in hierarchy. Or did I misunderstand you?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform