I have 2 forms. One have a textbox to show name of chosen Customer and one have datagridview to show list of customers. When i click on textbox the second form will open. I want to know is it possible to double click on datagridview cell then the text of textbox change by datagridview selected cell on first form? Here is my codes.
I wrote this code to open form2:
private void textBox1_Click(object sender, EventArgs e)
{
frmCustomer customer = new frmCustomer();
customer.ShowDialog();
}
and in form2 :
private void dataGridView1_CellDoubleClick(object sender,DataGridViewCellEventArgs e)
{
string name = dataGridView1.CurrentRow.Cells["clmName"].Value.ToString();
form1 f = new form1();
f.txtCustomer.Text = name;
this.close();
}
there is nothing in textbox when form2 closed.
any Help? Thanks a milion