Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Read only for all fields
Message
 
 
À
08/08/2009 12:36:07
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
01416802
Message ID:
01416908
Vues:
85
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform