this.hide();
Form2 frm=new Form2();
frm.show();
这只是把Form1给隐藏不是关了
要是直接this.Close();好象什么都没了-_#.
this.Close();
Form2 frm=new Form2();
frm.show();
要不
Form2 frm=new Form2();
frm.show();
this.Close();
这样也不行
请问要怎么才能打开一个窗体....难后关闭原来那个??
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
XtraForm1 frm = new XtraForm1();
frm.Show();
this.Hide();
}
}
public partial class Form1 : Form
{
public Form2()
{
InitializeComponent();
this.FormClosed += new FormClosedEventHandler(Form2_FormClosed);
}
void Form2_FormClosed(object sender, FormClosedEventArgs e)
{
Application.Exit();
}
}