I am trying to write code that will allow the following function to pause for a certain amount of time during each iteration of the for loop, and it has been driving me crazy for a few days. I do not want to use sleep because the user needs to enter data into the text boxes in the array during the time that it is paused. I appreciate any help you can provide.
private void start_Click(object sender, EventArgs e){
for (var i = 1; i <= 240; i++ )
{
student_array[i].Focus();
student_array[i].BackColor = Color.CornflowerBlue;
if (i > 1)
{
student_array[(i - 1)].BackColor = Color.White;
}
}
}