There are different ways you can go around this.
One approach is to throw events from control 2 that indicate
that a
certain change needs to occur; the parent form or control
can subscribe
to the event and change contents in control 1.
Another faster but not as elegant way is to make the parent
container
implement an interface; say IControl1Updater that has a
property
symbolizing what you need to change in control 1. you can
then cast the
parent container of control 2 to that interface and change
the
property; i.e. from control 2:
( (IControl1Updater) this.Parent).LabelText = "some
value";
You can pass references as well; i.e. pass a reference of
control 1 to
control 2 in a property or constructor...etc.
hope this helps.
Mario
|