private void btnAddPerson_Click(object sender, EventArgs e) { PersonForm form = PersonForm.GetInstance(PersonForm.FormType.ADDITION); form.FormClosing += OnFormClosing; if (!form.Visible) { form.Show(); } else { form.BringToFront(); } }
private void dgvOverview_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { PersonForm form = PersonForm.GetInstance(PersonForm.FormType.MODIFICATION, int.Parse(dgvOverview.Rows[e.RowIndex].Cells["colOverPersonID"].Value.ToString())); form.FormClosing += OnFormClosing; if (!form.Visible) { form.Show(); } else { form.BringToFront(); } }