It's Easy!
First of all you can't reach other forms controls in c# in the normal way that vb.net does, so you can do the following:
- Preparing form to receive data:
1- In the form constructor void add parameters to handle the received data.
2- After the InitializeComponent(); void add the lines of code like below:
public frm1(string txt1, string txt2, string txt3)
{
InitializeComponent();
textBox1.Text = txt1;
textBox2.Text = txt2;
textBox3.Text = txt3;
}
Handle the datagridview dg_RowHeaderMouseDoubleClick event:
-Note: you can also handle the CellDoubleClick event in your example, but my event is make more sense.
1- Create variables to hold the sent data.
2- Create a new form instance for the form that will handle the data and pass the row cells data to the method parameters in the exact desired order.
private void dg_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
{
//Collect the row cells values:
string val1 = dg.Rows[e.RowIndex].Cells[0].Value.ToString() //data of the first cell in the row
string val2 = dg.Rows[e.RowIndex].Cells[1].Value.ToString() //data of the second cell in the row
string val3 = dg.Rows[e.RowIndex].Cells[2].Value.ToString() //data of the third cell in the row
//Initialize a new instance of the data handle form and send the row data to it:
var newFrm = new frm1(val1, val2, val3);
newFrm.Show();
}
And so on, you can create as many parameters as you can.