/// <summary> /// brings up a blank details form to input a new student /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnNewStudent_Click(object sender, EventArgs e) { //create instance of second form frmStuDetails NewDetailForm = new frmStuDetails(); NewDetailForm.ShowDialog(); //show form //refresh listbox loadStudents(); }
/// <summary> /// brings up the selected student's record for viewing or editing /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnEdit_Click(object sender, EventArgs e) { //ensure something was selected if (lstStudents.SelectedIndex > -1) { //create instance of second form frmStuDetails StudentDetailForm = new frmStuDetails(intStudentID[lstStudents.SelectedIndex]); StudentDetailForm.ShowDialog(); //show equipment details //refresh listbox loadStudents(); } else { MessageBox.Show("Select a student display record details."); } }