private void H_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { foreach (DataGridViewRow ROW in H.SelectedRows) { string a, b = ""; a = this.H.CurrentRow.Cells[0].Value.ToString(); b = this.H.CurrentRow.Cells[1].Value.ToString(); Form11 suplidor = new Form11(); foreach (Form ocle in Application.OpenForms) { if (ocle.Name == "Form11") { suplidor = (Form11)ocle; suplidor.txt_IdProveedor.Text = a; suplidor.txtEmpresa.Text = b; this.Hide(); } } } }
private void HH_MouseDoubleClick(object sender, MouseEventArgs e) { foreach (DataGridViewRow row in HH.SelectedRows) { string a, b, c, d = ""; a = this.HH.CurrentRow.Cells[0].Value.ToString(); b = this.HH.CurrentRow.Cells[1].Value.ToString(); c = this.HH.CurrentRow.Cells[2].Value.ToString(); d = this.HH.CurrentRow.Cells[3].Value.ToString(); Form1 FACTURA = new Form1(); Form11 suplidor = new Form11(); foreach (Form oo in Application.OpenForms) { if (oo.Name == "Form1") { FACTURA = (Form1)oo; FACTURA.txtCod_Ar.Text = a; FACTURA.txtArticulo.Text = b; FACTURA.txtPrecio_U.Text = d; this.Hide(); // si no hay nada en el stock que no permita la insercion } else if (oo.Name == "Form11") { suplidor = (Form11)oo; suplidor.txtCod_Art.Text = a; suplidor.txtArticlo.Text = b; suplidor.txtPrecio_u.Text = d; this.Hide(); } } } }