private void button1_Click(object sender, EventArgs e)
{
book_infoBindingSource.EndEdit();
MessageBox.Show("保存成功!");
//book_infoBindingSource.AddNew();
this.Close();
Form2 fm = new Form2();
fm.Show();
}
form2的窗体显示不出来,这是怎么回事呢?求大侠指点
你先Close了.第一个窗口关闭,释放资源了,所以后面的代码不会执行了,
应该先第二个窗体show,然后再第一个窗体close
this.Close();这句话不要
fm.Show();后面加上this.Hide();
private void button1_Click(object sender, EventArgs e) { book_infoBindingSource.EndEdit(); MessageBox.Show("保存成功!"); //book_infoBindingSource.AddNew(); Form2 fm = new Form2(); fm.Show(); this.Close(); }