Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I Disable all the textboxes in a form?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00187810
Message ID:
00188381
Vues:
17
>>>>Before using code like this in more than a place or two, you should consider writing a custom form.DoSetAll (or something routine) that recognizes a container object in the controls collecitons and recurses back into itself to loop through the container's controls colleciton as well.
>>>
>>>I also thought about the possibility that all my container classes would at some point have a custom MySetAll method, accepting the same parameters as SetAll except assuming the third was a base class, and using my original loop. Forms which contained these container classes could know about those methods without violating OOP rules, right?
>>
>>IMHO, yes, this is Ok. But your original loop won't always be enough; it won't account for nested pageframes or containters inside pageframes or vice-versa. This is really only generically solvable IMHO with a recursive routine.
>
>OK. Recursion is dangerous but not impossible to manage. Like a skilsaw, very efficient if used properly, just be careful not to cut off your hand! :)
>
>Cheers,
>Rich.


What is the danger? This is exactly the scenerio to use recursive calls.

To the SetAll method, you can add a parameter to accept an object. That way you have your SetAll method for any container object in one spot.

Joe
Joseph C. Kempel
Systems Analyst/Programmer
JNC
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform