My TextBox
and Label
Text
property does not update when I call a method from another Form
?
Here is the code
//Form1 Codes
private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{
Form2 frm= new Form2 ();
frm.UpdateText(this.treeView1.SelectedNode.Text.ToString());
this.Close();
}
//Form2 codes
//show Form1
private void Button1_Click(object sender, EventArgs e)
{
Form1 Frm = new Form1();
Frm.ShowDialog();
}
//update Textbox and lable
public void UpdateText(string text)
{
this.label1.Text = text;
textBox1.Text = text;
label1.Refresh();
}
Thanks in advance.