Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I disable fields on a Pageframe
Message
De
31/05/2002 15:13:39
Charlie Schreiner
Myers and Stauffer Consulting
Topeka, Kansas, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00663496
Message ID:
00663617
Vues:
20
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
Charlie
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform