>>>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.
Rich Addison, Micro Vane, Inc., Kalamazoo, MI
Relax, don't worry, have a homebrew.
- Charlie Papazian, The New Complete Joy of Home Brewing