title: MessageBox is showing multiple times in C#
body: <p>I am trying to build a code where it will be able to after passing a time span it will display a <code>MessageBox</code> to alert the user that he needs to solve the task scheduled by him.</p>
  
  <p>This is the code I got:</p>
  
  <pre><code>private void timer1_Tick(object sender, EventArgs e)
  {
      GetTimeStamp();
  }
  
  private void GetTimeStamp()
  {
      foreach (DataGridViewRow row in dataGridView1.Rows)
      {
          bool bDisplayed = false;
          TimeSpan span = (DateTime.Now - Convert.ToDateTime(row.Cells[2].Value));
  
          String.Format("{0}, {1}, {2}",
              span.Hours, span.Minutes, span.Seconds);
  
          row.Cells[3].Value = span.ToString(@"hh\:mm\:ss").Trim();
  
          if (Convert.ToDateTime(row.Cells[3].Value) &gt;= DateTime.Parse("0:05:00")
              &amp;&amp; Convert.ToDateTime(row.Cells[3].Value) &lt;= DateTime.Parse("0:19:59") 
              &amp;&amp; row.Cells[1].Value.ToString().Trim() == "4 - Needs to be solved")
          {
  
                  MessageBox.Show("There is one or more tasks to be solved", "Informação", MessageBoxButtons.OK, MessageBoxIcon.Error);
                  break;
          }
      }
  }
  </code></pre>
  
  <p>The problem is that the <code>MessageBox</code> is displaying multiple times until it gets the <code>DateTime.Parse("0:19:59")</code>. I just what it to display the message one time.</p>
  
  <p>How can I solve it?</p>