public void CreateFrmChild() { Frm_Child BabyWindow = new Frm_Child();//实例化一个子窗体 BabyWindow.MdiParent = this;//设置子窗体的父窗体为当前窗体 this.dataGridView1.Controls.Add(BabyWindow);//在DataGridView控件中添加子窗体 BabyWindow.UpdateDataGridView += new EventHandler(BabyWindow_UpdateDataGridView); BabyWindow.Show();//显示子窗体 }
public void CreateFrmChild() { Frm_Child BabyWindow = new Frm_Child(); //實例化一個子視窗 BabyWindow.MdiParent = this; //設定子視窗的父視窗為目前視窗 this.dataGridView1.Controls.Add(BabyWindow); //在DataGridView控制元件中新增子視窗 BabyWindow.UpdateDataGridView += new EventHandler(BabyWindow_UpdateDataGridView); BabyWindow.Show(); //顯示子視窗 }
public void CreateFrmChild() { Frm_Child BabyWindow = new Frm_Child(); //实例化一个子窗体 BabyWindow.MdiParent = this; //设置子窗体的父窗体为当前窗体 this.dataGridView1.Controls.Add(BabyWindow); //在DataGridView控件中添加子窗体 BabyWindow.UpdateDataGridView += new EventHandler(BabyWindow_UpdateDataGridView); BabyWindow.Show(); //显示子窗体 }