Ejemplo n.º 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            NewStudent newForm = new NewStudent();
            Student    student = newForm.GetNewStudent();

            if (student != null)
            {
                students += student;
            }
        }
Ejemplo n.º 2
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            int i = lstStudents.SelectedIndex;

            if (i != -1)
            {
                Student student = students[i];
                string  message = "Are you sure you want to delete."
                                  + student.Name + "?";
                DialogResult button = MessageBox.Show(message, "Confirm Delete", MessageBoxButtons.YesNo);
                if (button == DialogResult.Yes)
                {
                    students -= student;
                }
            }
        }
Ejemplo n.º 3
0
 private void HandleChange(StudentList students)
 {
     FillStudentListBox();
 }