窗體部分: Form1:主窗體(IsMdiContainer屬性設定為true,textBox1的Modifiers屬性設定為public) Form2:子窗體 代碼部分: //父窗體 Form2 f2 = new Form2();
f2.Owner = this;
f2.ShowDialog(); //子窗體 Form1 f1=new Form1();
f1=(Form1)this.Owner;
f1.textBox1.Text="子窗體通路了主窗體";
轉載于:https://www.cnblogs.com/nb08611033/p/8932101.html