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 }
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 }