private void BtnAddStudent_Click(object sender, EventArgs e) { FrmAddAndUpdateStudent addStuForm = new FrmAddAndUpdateStudent(); addStuForm.ShowDialog(); PopulateStudentListBox(); }
private void BtnUpdateStudent_Click(object sender, EventArgs e) { Student selectedStu = lstStudents.SelectedItem as Student; var updateForm = new FrmAddAndUpdateStudent(selectedStu); updateForm.ShowDialog(); PopulateStudentListBox(); }