Hello everyone, a lot of greetings and thank you very much to everyone who takes the time to see this publication and thanks to anyone who can help me.
I am trying to pass data from two textboxes that I have in Form2, here I put the button code, but it gives me an error.
See who can help me.
In
Form1 I have a DatagridView, it is where I want to pass the data, but the path gives me an error The
DatagridView is inside a
TabPanel1, contained in the
TapControl1, this in turn you are inside a
Panel1 of a
SplitContainer1.
- private void btnEnter_Click(object sender, System.EventArgs e)
- {
- Form1 dato = new Form1 ();
- foreach (Form crl in Application.OpenForms)
- {
- if (crl.Name == " Form1 ")
- {
- dato = (Form1)crl;
- dato.splitContainer1.Panel1.TabControl1.tabPage1.DataGridView1.Rows.Add(txtName.Text, txtCity.Text);
-
- this.Close();
- break;
- }
- }
- }