private void button1_Click(object sender, EventArgs e) { if (Application.OpenForms.OfType <NuevoArticulo>().Count() == 1) { Application.OpenForms.OfType <NuevoArticulo>().First().Focus(); } else { NuevoArticulo frm = new NuevoArticulo(); frm.Show(); } }
private void button1_Click(object sender, EventArgs e) { createorupdate.status = "create"; if (Application.OpenForms.OfType <NuevoArticulo>().Count() == 1) { Application.OpenForms.OfType <NuevoArticulo>().First().Focus(); } else { NuevoArticulo frm = new NuevoArticulo(); frm.ShowDialog(); } }
private void button9_Click(object sender, EventArgs e) { int rowIndex = dataGridView1.CurrentCell.RowIndex; createorupdate.itemid = dataGridView1.Rows[rowIndex].Cells[0].Value.ToString(); createorupdate.status = "update"; if (Application.OpenForms.OfType <NuevoArticulo>().Count() == 1) { Application.OpenForms.OfType <NuevoArticulo>().First().Focus(); } else { NuevoArticulo frm = new NuevoArticulo(); frm.ShowDialog(); } }