void ButtonClick(object sender, EventArgs e){ if (running) { //notify the thread (the recursive function) to continue } else functionCall(0);}void functionCall(int num){ if (num % 2 == 0) { displaySomething(); //wait } functionCall(num + 1);}
void ButtonClick(object sender, EventArgs e){ if (running) {
//notify the thread (the recursive function) to continue
}
else functionCall(0);}void functionCall(int num){
if (num % 2 == 0)
{
displaySomething();
//wait
functionCall(num + 1);}