示例#1
0
        private void Edit(object sender, EventArgs e)
        {
            var editStudent = new EditStudentForm(_student);

            editStudent.ShowDialog();
            UpdateForm();
        }
示例#2
0
        private void Edit(object sender, EventArgs e)
        {
            if (StudentsListBox.SelectedItem == null)
            {
                MessageBox.Show(@"You must select the student you want to edit", @"No student selected", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            var editStudent = new EditStudentForm((Student)StudentsListBox.SelectedItem);

            editStudent.ShowDialog();
            UpdateList();
        }