8 个解决方案
#1
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
form2 f=new form2()
f.visable=true;
或
f.show();
this.close();
}
#2
Form2 form = new Form2();
form.FormClosed += delegate { this.Show(); };
form.Show();
this.Hide();
#3
有hide功能的。
#4
正解
#5
form f=new form();
f.show();
f.visable=true;
this.close;
f.show();
f.visable=true;
this.close;
#6
上面的全都不行,没有弹出另外一个窗口的效果
#7
在父窗体(FormParent)里面写
FormSon son=new FormSon(this);
if(son.ShowDialog()==DialogResult.OK)
{
this.Visible=true;
}
在弹出的窗体里面写
FormParent _frmParent;
public FormSon(FormParent frmParent)
{
this._frmParent=frmParent;
_frmParent.Visible=false;
}
在子窗体关闭时,或者某个按钮事件下面
private void FormSon_FormClosing(object sender, FormClosingEventArgs e)
{
this.DialogResult==DialogResult.Ok;
FormSon son=new FormSon(this);
if(son.ShowDialog()==DialogResult.OK)
{
this.Visible=true;
}
在弹出的窗体里面写
FormParent _frmParent;
public FormSon(FormParent frmParent)
{
this._frmParent=frmParent;
_frmParent.Visible=false;
}
在子窗体关闭时,或者某个按钮事件下面
private void FormSon_FormClosing(object sender, FormClosingEventArgs e)
{
this.DialogResult==DialogResult.Ok;
#8
直接在上一个窗体中close()是不行的。这个问题也困扰我好久,今天刚自己解决掉。设置两个窗体,Form1是启动封面,Form2是主程序。在 paogram文件里 Application.Run(new Form1());后加一句 Application.Run(new Form2());在Form1里加一个timer,到某个时候时Form1.close(),然后form2就回自动出来了,而form1则彻底关闭,不影响form2
#1
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
form2 f=new form2()
f.visable=true;
或
f.show();
this.close();
}
#2
Form2 form = new Form2();
form.FormClosed += delegate { this.Show(); };
form.Show();
this.Hide();
#3
有hide功能的。
#4
正解
#5
form f=new form();
f.show();
f.visable=true;
this.close;
f.show();
f.visable=true;
this.close;
#6
上面的全都不行,没有弹出另外一个窗口的效果
#7
在父窗体(FormParent)里面写
FormSon son=new FormSon(this);
if(son.ShowDialog()==DialogResult.OK)
{
this.Visible=true;
}
在弹出的窗体里面写
FormParent _frmParent;
public FormSon(FormParent frmParent)
{
this._frmParent=frmParent;
_frmParent.Visible=false;
}
在子窗体关闭时,或者某个按钮事件下面
private void FormSon_FormClosing(object sender, FormClosingEventArgs e)
{
this.DialogResult==DialogResult.Ok;
FormSon son=new FormSon(this);
if(son.ShowDialog()==DialogResult.OK)
{
this.Visible=true;
}
在弹出的窗体里面写
FormParent _frmParent;
public FormSon(FormParent frmParent)
{
this._frmParent=frmParent;
_frmParent.Visible=false;
}
在子窗体关闭时,或者某个按钮事件下面
private void FormSon_FormClosing(object sender, FormClosingEventArgs e)
{
this.DialogResult==DialogResult.Ok;
#8
直接在上一个窗体中close()是不行的。这个问题也困扰我好久,今天刚自己解决掉。设置两个窗体,Form1是启动封面,Form2是主程序。在 paogram文件里 Application.Run(new Form1());后加一句 Application.Run(new Form2());在Form1里加一个timer,到某个时候时Form1.close(),然后form2就回自动出来了,而form1则彻底关闭,不影响form2