打开一个的同时,关闭现在打开的所有子窗体
打开一个的同时,关闭现在打开的所有子窗体
2006-02-07 13:24
if(this.MdiChildren.Length>0)
{
foreach(Form child in this.MdiChildren)
{
child.Close();
}
}
Form abc=new Form();
abc.show();

2006-02-08 12:33
private void Form1_Load(object sender, System.EventArgs e)
{
Form2 f=new Form2();
f.MdiParent=this;
f.Show();
Form3 ff=new Form3();
ff.MdiParent=this;
ff.Show();
}
private void button1_Click(object sender, System.EventArgs e)
{
if(this.MdiChildren.Length>0)
{
foreach(Form child in this.MdiChildren)
{
child.Close();
}
}
Form4 f=new Form4();
f.MdiParent=this;
f.Show();
}

2006-02-08 12:37
2006-02-09 16:34

2006-02-10 14:15
在Form1的函数中:
Form2 f = new Form();
f.ShowDialog();
if(f.flg == true)
{
Application.Run(new Form1());
}
在Form2中定义:
public bool flg = flash;
公有类不:
flg =true;
this.Close();

2006-04-09 22:36
2006-04-10 08:28
2006-04-10 13:43
2007-05-23 17:35