I want to list all objects in my ScoresList to a list box.
private void UpdateStudentScores_Load(object sender, EventArgs e)
{
students.Fill();
txtName.Text = students[index].WholeName;
lstScores.Items.Clear();
int s = 0;
for (int i = 0; i < students[index].ScoresList.Count; i++)
s = students[index].ScoresList[i];
lstScores.Items.Add(s);
}
I want to be adding "s" to my list four times because the students[index].ScoresList.Count = 4. Instead I only get the last element in my list displayed. Where did I go wrong?
Ctrl-E Ctrl-Din Visual Studio's code editor and you will see...