标签:style c class blog code java
Private childFrm myChildFrm = null; //定义子窗口对象 private void OpenChildFrmToolStripMenuItem_Click(object sender, EventArgs e) { myChildFrm = new ChildFrm();//创建子窗口对象 myChildFrm.Show();//显示子窗口 myChildFrm.Focus();//使子窗口获得焦点 }
private void OpenChildFrmToolStripMenuItem_Click(object sender, EventArgs e) { if(myChildFrm != null) { myChildFrm.Show();//显示子窗口 myChildFrm.Focus();//使子窗口获得焦点 } else { myChildFrm = new ChildFrm();//创建子窗口对象 myChildFrm.Show();//显示子窗口 myChildFrm.Focus();//使子窗口获得焦点 } }
private void OpenChildFrmToolStripMenuItem_Click(object sender, EventArgs e) { if(myChildFrm != null) { if(myChildFrm.IsDisposed) myChildFrm = new ChildFrm();//如果已经销毁,则重新创建子窗口对象 myChildFrm.Show(); myChildFrm.Focus(); } else { myChildFrm = new ChildFrm(); myChildFrm.Show(); myChildFrm.Focus(); } }
private void OpenChildFrmToolStripMenuItem_Click(object sender, EventArgs e) { if(myChildFrm == null || myChildFrm.IsDisposed) { myChildFrm = new ChildFrm(); } myChild..MdiParent = this; //建立父子关系 myChildFrm.Show(); //显示子窗口 myChildFrm.Focus(); //子窗口获得焦点 }
(转)C#在父窗口中调用子窗口的过程(无法访问已释放的对象),布布扣,bubuko.com
(转)C#在父窗口中调用子窗口的过程(无法访问已释放的对象)
标签:style c class blog code java
原文地址:http://www.cnblogs.com/lxGIS/p/3735620.html