I am trying to change a property from one control one a window from another. How would I add data that is in one window to a combobox in another? Thanks.
Printable View
I am trying to change a property from one control one a window from another. How would I add data that is in one window to a combobox in another? Thanks.
The easy way would be to have the form have a reference to the other form.
Can you give me an example. I am kind of new to C#
Ok well i will asume you are opening one form from the other.
Simply put you could use the child object to access controls on form2 from form1 and the parent object to access controls on form1 from form2.Code:class form1
{
private form2 child;
public form1()
{
child = new form2(this);
}
}
class form2
{
private form1 parent;
public form2(form1 parent)
{
this.parent = parent;
}
}