Posts 1–4 of 4 · Page 1 of 1
Connect Four
Well, I've started developing a Connect Four game and I can't seem to figure out why the seventh row doesn't respond like the others do. I coded it the same for each row, but with the according array number.

Check the source and see if you can figure it out.
[X][X]
@Hassan, approve. @Sketchy: First, at top of your code, change this line:
Code:
Dim grid(6, 7) As System.Windows.Forms.Button
To
Code:
Dim grid(7, 7) As System.Windows.Forms.Button
Then, in the frmMain designer, double click btn17. It will create a new event handler. You current one is not recognized by the visual studio, so the new one will become:
Code:
Private Sub btn17_Click_1(sender As System.Object, e As System.EventArgs) Handles btn17.Click
End Sub
Inside that, paste the code you originally wrote for btn17. So, the new sub procedure now will be:
Code:
Private Sub btn17_Click_1(sender As System.Object, e As System.EventArgs) Handles btn17.Click
PlacePiece7()
CheckForWins()
If PlayerTurn = "Red" Then
PlayerTurn = "Blue"
ElseIf PlayerTurn = "Blue" Then
PlayerTurn = "Red"
End If
End Sub
Working fine now. Posts 1–4 of 4 · Page 1 of 1