private void btnAdd_Click(object sender, EventArgs e) { bool open = false; foreach (Form f in Application.OpenForms) { if (f == l) { open = true; } } if (!open) { if (id.ToLower() == "a") { l = new Licencas(); } else { l = new Licencas(num, true); } l.Show(); } else { l.Focus(); } }
private void btnEdit_Click(object sender, EventArgs e) { bool open = false; foreach (Form f in Application.OpenForms) { if (f == l) { open = true; } } if (!open) { l = new Licencas(dGVLicenc.SelectedRows[0].Cells[0].FormattedValue.ToString()); l.Show(); } else { l.Focus(); } }