my code:
in parent_Form:
public parent_Form()
{
InitializeComponent();
}
private void button_Click(object sender, EventArgs e)
{
child ch = new child();
ch.MdiParent = this;
ch.Show();
}
public string label
{
set
{
textBox1.Text = value;
}
}
in child form:
public child()
{
InitializeComponent();
}
private void write_button_Click(object sender, EventArgs e)
{
parent_Form paren = new parent_Form();
paren.label = "i am vietnamese";
}
but
“i am vietnamese” doesn’t display on textbox1 (it is on parent winform)
JRoughan’s solution should work. Make sure you have the button click handler properly specified. Set a breakpoint in the handler to make sure it is being executed when you click the button. I tested this and it works.