title: How to return control of flow to a for loop?
body: <p>I'm trying to code a loop to re execute a block of code 3 times. At the moment the code starts and executes once but doesn't repeat as intended with using the <code>for</code> loop.</p>
  
  <p>I've set a break point on the <code>for</code> loop and it only goes through the loop once.</p>
  
  <pre><code>    private async void startBtn_Tap(object sender, System.Windows.Input.GestureEventArgs e)
      {
          int i;
          int roundMax = 3;
  
           for (i = 1; i &lt;= roundMax; i++)
           {
                  //delay stop watch start to allow time to get ready.
                  TimeSpan time = TimeSpan.FromSeconds(1);
                  await System.Threading.Tasks.Task.Delay(time);
  
  
                  //set text box editing to false to prevent illegal input.
                  wrkTbx.IsEnabled = false;
                  restTbx.IsEnabled = false;
                  roundSlider.IsEnabled = false;
                  roundsTbx.IsEnabled = false;
  
                  StopGoCvs.Background = new SolidColorBrush(Colors.Green);
                  //startSoundElmt.Play();
                  // set up the timer
                  myTimer = new DispatcherTimer();
                  myTimer.Interval = new TimeSpan(0, 0, 0, 0, 1);
  
                  myTimer.Tick += myTimer_Tick;
  
                  // start both timers
                  myTimer.Start();
                  myStopwatch.Start();
  
  
  
          }
  
      }
  </code></pre>