110,538
社区成员
发帖
与我相关
我的任务
分享
// Form1
private unsafe void button1_Click(object sender, EventArgs e)
{
Form2 frm = new Form2();
frm.GetForm(this);
frm.Show();
}
// Form2
public Form1 form = null;
public void GetForm(Form1 theform)
{
form = theform;
}
private void button1_Click(object sender, EventArgs e)
{
Form3 frm = new Form3();
frm.GetForm(form);
frm.Show();
}
// Form3
public Form1 form = null;
public void GetForm(Form1 theform)
{
form = theform;
}
private void button1_Click(object sender, EventArgs e)
{
form.textBox1.Text = "testtest";/*此次需要将Form1设计窗体中的textbox1的属性从Private 改为public就可以再Form3中调用,否则会出现错误*/
}