I am creating a test creator / taker in windows forms. I have an array that stores the questions (retreived from a text file), and I have a foreach loop that sets up each question. How can I, within that foreach loop, wait for the "next question" button to be pressed before I continue to the next iteration?
Here is the code:
foreach(string info in testInfo) // Start the test
{
int correctAwnser = Convert.ToInt32(info.Split('>')[5]);
//get the correct awnser from array and store it as an int
SetUpQuestion(info); // Set up the question
RefreshAll(); // Refreshes everything on the form
WaitNextPressed(); // Wait for "next" to be pressed
AddQuestionToScore(correctAwnser);
// Add the question and correct awnser to the grade
}
I need to find a way to create the method "WaitNextPressed()", that waits for the "next" button to be pressed.
Thanks in advance to anybody who helps me out