C# 、子窗体调用父窗体属性、方法
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 namespace Test 2 { 3 public partial class FrmMain : Form 4 { 5 public FrmMain() 6 { 7 InitializeComponent(); 8 } 9 public DataTable DT; 10 private void button1_Click(object sender, EventArgs e) 11 { 12 FrmChild fm = new FrmOptime(this); 13 fm.Show(); 14 } 15 public void BindData(){} 16 } 17 }
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 namespace Test 2 { 3 public partial class FrmChild : Form 4 { 5 public FrmChild () 6 { 7 InitializeComponent(); 8 } 9 FrmMain frmMain; 10 public FrmChild (FrmMain fm) 11 { 12 InitializeComponent(); 13 frmMain = fm; 14 } 15 private void button1_Click(object sender, EventArgs e) 16 { 17 frmMain.RemnantDT; 18 frmMain.BindData(); 19 } 20 } 21 }
心若没有栖息的地方,到哪里都是在流浪!
——蓅烺ゞの貓