Hi,
I have started my new college course this week and received my first assignment, it is to create a simple noughts and crosses game.
So far all is well, I have created all of my procedures for checking for winners, reseting the game board and so on, the only issue I have is the button click events don't do anything when I click one of the nine buttons to put in either an X or O.
Please see below my code for the button click event (FYI I have changed all the font and colour properties for each button in the properties tab in VS).
Private Sub btn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
If cboUser.Text = "X" Then
Panel1.Enabled = True
btn1.Text = "X"
Else
cboUser.Text = "O"
Panel1.Enabled = True
btn1.Text = "O"
End If
Call CheckWinner()
End Sub
So to quickly explain what this is supposed to do, when a new game is started the user selects either a X or O from a combo box (cboUser) this action enables the panel control so the user can then insert either the X or O into a button in this case button 1, when the user selects the button the program checks to see if anyone has won. I have the same code for all 9 buttons but as I say nothing happens when I click any of the buttons.
I know there is loads of noughts and crosses games I can download and use other peoples code but that's just cheeting.
Can anyone help. If you need any code for the rest of the program please let me know.
Cheers