for (int i = 0; i < x + 10; i++)
{
for (int j = 0; j < x + 10; j++)
{
if ((list[i][j].Text != String.Empty && list[i + 1][j].Text != String.Empty && list[i + 2][j].Text != String.Empty && list[i + 3][j].Text != String.Empty && list[i + 4][j].Text != String.Empty)
|| (list[i][j].Text != String.Empty && list[i][j + 1].Text != String.Empty && list[i][j + 2].Text != String.Empty && list[i][j + 3].Text != String.Empty && list[i][j + 4].Text != String.Empty)
|| (list[i][j].Text != String.Empty && list[i + 1][j + 1].Text != String.Empty && list[i + 2][j + 2].Text != String.Empty && list[i + 3][j + 3].Text != String.Empty && list[i + 4][j + 4].Text != String.Empty)
|| (list[i][j].Text != String.Empty && list[i + 1][j - 1].Text != String.Empty && list[i + 2][j - 2].Text != String.Empty && list[i + 3][j - 3].Text != String.Empty && list[i + 4][j - 4].Text != String.Empty))
{
timer1.Enabled = false;
Win winner = new Win();
winner.StartPosition = FormStartPosition.CenterScreen;
winner.Show();
rex = true;
if (list[i][j].Text == "x")
{
winner.TxtBoxWin = "X WON!";
scoreX++;
scoreXtext = Convert.ToString(scoreX);
toolStripMenuItem4.Text = scoreXtext;
}
else if (list[i][j].Text == "o")
{
winner.TxtBoxWin = "O WON!";
scoreO++;
scoreOtext = Convert.ToString(scoreO);
toolStripMenuItem5.Text = scoreOtext;
rex = true;
break;
}
}
}
}