private void listBoxStudent_DoubleClick(object sender, EventArgs e) { if (listBoxStudent.SelectedItem != null) { var addStudentForm = new AddStudentForm(); var student = (Student)listBoxStudent.SelectedItem; addStudentForm.OpenInEdit(student); } }
private void btnAddStudent_Click(object sender, EventArgs e) { var addStudentForm = new AddStudentForm(); addStudentForm.ShowDialog(); }