vb
Option Explicit
' Scoring arrays
' These are added to determine when
' a player has won
Dim iXPos(3, 3) As Integer
Dim iOPos(3, 3) As Integer
' Determines who plays next AND
' Used as boolean test variable
Dim sPlaySign As String
' Counts the number of moves
Dim iMove As Integer
' Scoreboard variables
Dim iXScore As Integer
Dim iOScore As Integer
' Get ready to play another game
Sub InitPlayGround()
Dim i As Integer
Dim j As Integer
Dim e As Integer
' Erase any playing grid symbols
For i = 1 To 3
For j = 1 To 3
lblPlayGround((i - 1) * 3 + j - 1).Caption = ""
iXPos(i, j) = 0
iOPos(i, j) = 0
Next j
Next i
' Erase any win lines
For i = 0 To 7
linWin(i).Visible = False
Next i
' Set the next player to the appropriate sign
If optOPlayer.Value = True Then
sPlaySign = "O"
Else
sPlaySign = "X"
End If
' Number of moves so far is zero
iMove = 0
' The game isn't started until a player
' clicks the playing grid
' Display the label, not the command button
cmdNewGame.Visible = False
End Sub
Private Sub cmdExit2_Click()
Load frmGames
frmGames.Show
Unload Me
End Sub
Private Sub cmdNewGame_Click()
' This button is only visible after someone clicks the
' playing grid and is reset to not visible
' after a win or draw
If MsgBox("Do you want to end the current game?", _
vbYesNo, "Start a New Game?") = vbYes Then Call InitPlayGround
End Sub
Private Sub cmdPlayerVComputer_Click()
End Sub
Private Sub cmdNewGame1_Click()
' This button enabled after someone clicks the playing grid
If MsgBox("Do you want to end the current game?", _
vbYesNo, "Start a New Game?") = vbYes Then Call InitPlayGround
End Sub
Mod Edit: Please use code tags when posting your code. Code tags are used like so =>

Thanks,
PsychoCoder