C# Winform中如何获取父窗体中控件的信息
C# Winform中如何获取父窗体中控件的信息
C# Code:
private void button1_Click(object sender, EventArgs e)
{
Form1 form1 = this.Owner as Form1;
this.textBox1.Text = form1.GetText();
}
private void button2_Click(object sender, EventArgs e)
{
Form1 form1 = this.Owner as Form1;
this.textBox1.Text = form1.textBox1.Text;
}
下载源码: