当我从另一个调用方法时,我的TextBox
和Label
Text
属性不会更新Form
?
这是代码
//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();
}
提前致谢。