Since only the last move can determine the winner, you only have to check its neighbors:
count the number of adjacent buttons with the same color.
private const int RowCount = 6, ColumnCount = 7;
private Button[,] grid = new Button[RowCount, ColumnCount];
public bool Won(int row, int column) {
return DownAdjacent(row, column) + 1 >= 4
|| LeftUpAdjacent(row, column) + RightDownAdjacent(row, column) + 1 >= 4
|| LeftDownAdjacent(row, column) + RightUpAdjacent(row, column) + 1 >= 4;
}
private int DownAdjacent(int row, int column) {
Color color = grid[row, column].BackColor;
int count = 0;
for (int r = row - 1; r >= 0; --r, ++count) {
if (grid[r, column].BackColor != color) break;
}
return count;
}
private int LeftUpAdjacent(int row, int column) {
Color color = grid[row, column].BackColor;
int count = 0;
for (int r = row + 1, c = column - 1; r < RowCount && c >= 0; ++r, --c, ++count) {
if (grid[r, c].BackColor != color) break;
}
return count;
}
private int RightDownAdjacent(int row, int column) {
Color color = grid[row, column].BackColor;
int count = 0;
for (int r = row - 1, c = column + 1; r >= 0 && c < ColumnCount; --r, ++c, ++count) {
if (grid[r, c].BackColor != color) break;
}
return count;
}
private int RightUpAdjacent(int row, int column) {
Color color = grid[row, column].BackColor;
int count = 0;
for (int r = row + 1, c = column + 1; r < RowCount && c < ColumnCount; ++r, ++c, ++count) {
if (grid[r, c].BackColor != color) break;
}
return count;
}
private int LeftDownAdjacent(int row, int column) {
Color color = grid[row, column].BackColor;
int count = 0;
for (int r = row - 1, c = column - 1; r >= 0 && c >= 0; --r, --c, ++count) {
if (grid[r, c].BackColor != color) break;
}
return count;
}