this.close();关闭当前界面不好用.
一、我想点击按钮后关闭当前界面跳转到另一界面,但不好用,代码有问题么?
private void Add_btn_Click(object sender, EventArgs e)
{
Add_form frm = new Add_form();
frm.ShowDialog();
this.Dispose();
this.Close();
}
[解决办法]
this.Hide();
private void Add_btn_Click(object sender, EventArgs e)
{
Add_form frm = new Add_form();
frm.Show(); //frm.ShowDialog(); ShowDialog会阻塞线程
this.Dispose();
this.Close();
}