private void button1_Click(object sender, EventArgs e) { var form = Application.OpenForms.OfType <AddForm>().FirstOrDefault(); if (form != null) { form.Activate(); } else { form = new AddForm(); form.Show(); } }
private void addButton_Click(object sender, EventArgs e) { AddForm addForm = new AddForm(); addForm.Show(); }