I agree with you that It appears to violate encapsulation. But many of the objects we create are affected by the class objects we design. This follows the same principal. In this situation. The LAST command button needs to test for the existence of the NEXT button. If the NEXT button does not exist the LAST button still performs all of its intended functionality. Placeing the code in the button as opposed to the container allows for maximum reuseability of code, and eliminates the dependency on the container for controlling objects. This actually seems, at least to me, to be a better method of encapsulation, especially since, the command button can now fully accomplish its purpose whether or not the second button exists and whether or not a container wraps the two buttons together.
Terry Rooks
Software Systems Architect
Microsoft Certified Solution Developer.Net
If at first you don't succeed, then skydiving definitely isn't for you.