private int index; //index of score public UpdateScoreForm(UpdateStudentScoresForm parentForm, int index) //pull score from previous form. { this.parentForm = parentForm; this.index = index; InitializeComponent(); this.CurrentScore.Text = this.parentForm.GetScoreAtIndex(index).ToString(); }
private void updateStudent_Click_1(object sender, EventArgs e) { UpdateStudentScoresForm updateStudentForm = new UpdateStudentScoresForm(this, students.SelectedIndex); //pass curent info to new form updateStudentForm.Show(); //open new form }
public AddScoreForm(UpdateStudentScoresForm parentForm) { this.parentForm = parentForm; //allow adding score to previous student selected InitializeComponent(); }