Just set B's label to public rather than the default visibility -- you
can do it in the control properties.
Or, cleaner than that, I would usually create a public string property
in B and have that set the text property of the private control.
Remember that B is a class like any other, and its public interface
should be minimal and should not expose the internals ... so a simple
public property is the best way from an OO standpoint. The public
property remains constant even if you decide later that a different
control or multiple controls need to respond to the change of value.
And the client code in A need know nothing about the actual control or
its name or even whether the value set goes to a control at all ... it
just needs to concern itself with informing B of the change via a nice
generically named public property.
--Bob
AMP wrote:
Hello,
I have an mdi program with a child form ("A") and another child ("B").
I want to change the text of a label on A by changing an item from a
combobox on B. I can code the comboBox1_Selec tedIndexChanged that is on
B but I dont know how to send that info to the label on A.I cant seem
to access A from B.
Help
Thanks
Mike
A.label from B. combobox.