Hi All,

I dont quite understand why this wont work i was hoping someone could help, I have got a noughts and crosses game and its all finished appart from the checkdraw sub routine i forgott to write in, so I wrote it out as below:

Private Sub CheckDraw()

If btn2.Text.Length = 1 and so on until btn10 Then
ScoreX += 1
ScoreO += 1
MessageBox.Show("Draw")
End If
End Sub

Now ScoreX and ScoreO are two variables declaired at form level, I use a very simaler routine for CheckWin and that works a treat.

My problem is that when a draw is detected the message box comes up ok but no scores are added to the label control.


Can anyone see anything im missing.

Thanks very much

John

Recommended Answers

All 2 Replies

Because you are not changing the Text of the label controls.

Try something like:

ScoreX += 1
ScoreO += 1

scoreXLabel.Text = ScoreX
scoreYLabel.Text = ScoreY

Thanks

Nice one, thanks for that farooqa, works a treat.

Thanks again mate.

John

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.