title: task completion
body: <p>I have a loop that creates multiple tasks as shown below. 
  How do I update the screen (add a new line to a textbox with some data) as each task completes?</p>
  
  <p>How do I detect when all tasks are complete?</p>
  
  <p><strong>C# Code</strong></p>
  
  <pre><code> for (int i = 0; i &lt; int.Parse(radTextBoxFloodRequests.Text); i++)
   {
        int x = i;
        // Create a task and supply a user delegate by using a lambda expression. 
        var taskA = new Task(() =&gt; TaskRequest(int.Parse(radTextBoxFirstNumber.Text), int.Parse(radTextBoxSecondNumber.Text), int.Parse(radTextBoxFloodDelay.Text), x));
        // Start the task.
        taskA.Start();
   }
  
  
   private void TaskRequest(int number1, int number2, int delay, int count)
   {
        // Some long running method
   }
  </code></pre>