private void btnAdd_Click(object sender, EventArgs e) { var addEditStuden = new AddEdditStudent(); addEditStuden.FormClosing += AddEditStuden_FormClosing; addEditStuden.ShowDialog(); }
private void btnEdit_Click(object sender, EventArgs e) { if (dgvDiary.SelectedRows.Count == 0) { MessageBox.Show("Zaznacz ucznia którego dane chcesz edytować"); return; } var addEditStuden = new AddEdditStudent(Convert.ToInt32(dgvDiary.SelectedRows[0].Cells[0].Value)); addEditStuden.FormClosing += AddEditStuden_FormClosing; addEditStuden.ShowDialog(); }