private void EditButton_Click(object sender, EventArgs e) { Button btn = (Button)sender; int x = 0; Int32.TryParse(btn.Name, out x); Bookings book = new Bookings(); book.SetUpFromBookingsManager(x); book.FormClosing += BookingsClosing; book.ShowDialog(); }
private void btn_new_Click(object sender, EventArgs e) { Form fm = Application.OpenForms["Bookings"]; if (fm != null) { fm.BringToFront(); } else { Bookings st = new Bookings(); st.FormClosing += BookingsClosing; st.ShowDialog(); } }