On Tue, 03 Jul 2007 14:40:59 -0700, M K <sk********************@yahoo.com>
wrote:
I have 2 classes. One where the form resides and I created another one
for
all the database stuff.
after i get data from the db i want to be able to update the form. I
have
the namespace of where the form code is but how do i get to the controls
themselves.
Well, the "cheesy" way is to simply change the member fields for the
controls so that their access is public instead of private.
But it would be much better to expose the aspects of those controls that
you want to allow access to as properties or in some cases methods.
Those, you make a part of the public API that the form class exposes,
allowing the form class complete control over what client's of the form
class can do, rather than handing over the actual instance to the controls
(which provides implementation details that only the form should know
about).
Pete