弹出了新窗体,但关闭自身无法现实!
private void dataGridView1_CellContentClick_(object sender, DataGridViewCellEventArgs e)
{
frmClinetInfo frmclient = new frmClinetInfo(_frm1 );
frmclient.txtClientNo.Text =dgvResult.CurrentRow.Cells[0].Value.ToString().Trim();
frmclient.txtName.Text = dgvResult.CurrentRow.Cells[1].Value.ToString().Trim();
this.close() //关闭自身无法现实
frmclient.StartPosition = FormStartPosition.Manual;// 弹出了新窗体
frmclient.Location = new Point(650, 100);
frmclient.ShowDialog() ;
------解决方案--------------------
this.Hide();
或者
this.Close();
System.Threading.Thread thread = new System.Threading.Thread(delegate() { new frmClinetInfo().ShowDialog(); });
thread.Start();
------解决方案--------------------
设置frmclient.Owner=别的窗体试试
------解决方案--------------------
Response.Write("<script language='javascript'>window.close();</script>");
------解决方案--------------------
this.Close();
System.Threading.Thread thread = new System.Threading.Thread(delegate()
{ frmClinetInfo frmclient = new frmClinetInfo(_frm1 );
frmclient.StartPosition = FormStartPosition.Manual;// 弹出了新窗体
frmclient.Location = new Point(650, 100);
frmclient.ShowDialog();
});
thread.Start();