Closing one form while keeping other form open
Hi,
I have a Main Form which is the parent form.I open Form1 inside the parent form and Form1 has a textbox textbox1.On textbox1_textchanged event i should open Form2 and pass a value to it keeping Form1 opened.Depending upon that value the datagridview on Form2 gets populated.Up to here it is fine.Now what i need is when i leave the Textbox1(ie,textbox1_leave event) i should close the Form2.How can i acheive that
My code for Textchanged event in Form1 is
private void textBox1_TextChanged(object sender, EventArgs e)
{
bookname = textBox1.Text;
Form2 obj = new Form2();
obj.Show();
textBox1.Focus();
}
Thanks in advance