Show just one message box
<p>I'm trying to show just one message box using the gameover bool to control the situation but it doesn't work, its showing infinite message boxes.</p>

<pre><code>bool player2turn = false;
bool gameover = false;


private void timer1_Tick(object sender, EventArgs e)
 {

  if ((pb00.BackColor == pb10.BackColor) &amp;&amp; (gameover == false))
     {
       winner();               
     }


 }

private void winner()
 {

  if (player2turn == false)
     {
       MessageBox.Show("Player 2 wins!", "Retry?", MessageBoxButtons.YesNo);
       gameover = true;
      }
  else
      {
       MessageBox.Show("Player 1 wins!", "Retry?", MessageBoxButtons.YesNo);
       gameover = true;

      }

  }
</code></pre>