VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton quit 
      Caption         =   "&Quit"
      Height          =   495
      Left            =   2640
      TabIndex        =   10
      Top             =   1440
      Width           =   1215
   End
   Begin VB.CommandButton clear 
      Caption         =   "&Clear"
      Height          =   495
      Left            =   2640
      TabIndex        =   9
      Top             =   600
      Width           =   1215
   End
   Begin VB.Line Line4 
      X1              =   120
      X2              =   2280
      Y1              =   1680
      Y2              =   1680
   End
   Begin VB.Line Line3 
      X1              =   120
      X2              =   2280
      Y1              =   960
      Y2              =   960
   End
   Begin VB.Line Line2 
      X1              =   1560
      X2              =   1560
      Y1              =   240
      Y2              =   2520
   End
   Begin VB.Line Line1 
      X1              =   840
      X2              =   840
      Y1              =   240
      Y2              =   2520
   End
   Begin VB.Label Label9 
      BackColor       =   &H00FF0000&
      ForeColor       =   &H00FFFF00&
      Height          =   495
      Left            =   1680
      TabIndex        =   8
      Top             =   1800
      Width           =   495
   End
   Begin VB.Label Label8 
      BackColor       =   &H00FF0000&
      ForeColor       =   &H00FFFF00&
      Height          =   495
      Left            =   960
      TabIndex        =   7
      Top             =   1800
      Width           =   495
   End
   Begin VB.Label Label7 
      BackColor       =   &H00FF0000&
      ForeColor       =   &H00FFFF00&
      Height          =   495
      Left            =   240
      TabIndex        =   6
      Top             =   1800
      Width           =   495
   End
   Begin VB.Label Label6 
      BackColor       =   &H00FF0000&
      ForeColor       =   &H00FFFF00&
      Height          =   495
      Left            =   1680
      TabIndex        =   5
      Top             =   1080
      Width           =   495
   End
   Begin VB.Label Label5 
      BackColor       =   &H00FF0000&
      ForeColor       =   &H00FFFF00&
      Height          =   495
      Left            =   960
      TabIndex        =   4
      Top             =   1080
      Width           =   495
   End
   Begin VB.Label Label4 
      BackColor       =   &H00FF0000&
      ForeColor       =   &H00FFFF00&
      Height          =   495
      Left            =   240
      TabIndex        =   3
      Top             =   1080
      Width           =   495
   End
   Begin VB.Label Label3 
      BackColor       =   &H00FF0000&
      ForeColor       =   &H00FFFF00&
      Height          =   495
      Left            =   1680
      TabIndex        =   2
      Top             =   360
      Width           =   495
   End
   Begin VB.Label Label2 
      BackColor       =   &H00FF0000&
      ForeColor       =   &H00FFFF00&
      Height          =   495
      Left            =   960
      TabIndex        =   1
      Top             =   360
      Width           =   495
   End
   Begin VB.Label Label1 
      BackColor       =   &H00FF0000&
      ForeColor       =   &H00FFFF00&
      Height          =   495
      Left            =   240
      TabIndex        =   0
      Top             =   360
      Width           =   495
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim player As Boolean
Dim winner As Boolean

Private Sub clear_Click()
Label1 = ""
Label2 = ""
Label3 = ""
Label4 = ""
Label5 = ""
Label6 = ""
Label7 = ""
Label8 = ""
Label9 = ""
player = True
winner = False
End Sub

Private Sub Form_Load()
player = True
winner = False
End Sub

Private Sub Label1_Click()
If player = True Then
    If Label1.Caption = "" Then
        Label1.Caption = "X"
        player = False
    End If
    If Label1.Caption = "O" Then
        MsgBox "Illegal Move"
    End If

Else
    If Label1.Caption = "" Then
        Label1.Caption = "O"
        player = True
    End If
    If Label1.Caption = "X" Then
        MsgBox "Illegal Move"
    End If

End If
If Label1 = "X" And Label2 = "X" And Label3 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label1 = "X" And Label4 = "X" And Label7 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label1 = "X" And Label5 = "X" And Label9 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label4 = "X" And Label5 = "X" And Label6 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label7 = "X" And Label8 = "X" And Label9 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label7 = "X" And Label5 = "X" And Label3 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label2 = "X" And Label5 = "X" And Label8 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label3 = "X" And Label6 = "X" And Label9 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If

If Label1 = "O" And Label2 = "O" And Label3 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label1 = "O" And Label4 = "O" And Label7 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label1 = "O" And Label5 = "O" And Label9 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label4 = "O" And Label5 = "O" And Label6 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label7 = "O" And Label8 = "O" And Label9 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label7 = "O" And Label5 = "O" And Label3 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label2 = "O" And Label5 = "O" And Label8 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label3 = "O" And Label6 = "O" And Label9 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If


If Label1 <> "" And Label2 <> "" And Label3 <> "" And Label4 <> "" And Label5 <> "" And Label6 <> "" And Label7 <> "" And Label8 <> "" And Label9 <> "" And winner = False Then
MsgBox "The Game is a Tie!"
End If

End Sub

Private Sub Label2_Click()
If player = True Then
    If Label2.Caption = "" Then
        Label2.Caption = "X"
        player = False
    End If
    If Label2.Caption = "O" Then
        MsgBox "Illegal Move"
    End If

Else
    If Label2.Caption = "" Then
        Label2.Caption = "O"
        player = True
    End If
    If Label2.Caption = "X" Then
        MsgBox "Illegal Move"
    End If

End If

If Label1 = "X" And Label2 = "X" And Label3 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label1 = "X" And Label4 = "X" And Label7 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label1 = "X" And Label5 = "X" And Label9 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label4 = "X" And Label5 = "X" And Label6 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label7 = "X" And Label8 = "X" And Label9 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label7 = "X" And Label5 = "X" And Label3 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label2 = "X" And Label5 = "X" And Label8 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label3 = "X" And Label6 = "X" And Label9 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If

If Label1 = "O" And Label2 = "O" And Label3 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label1 = "O" And Label4 = "O" And Label7 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label1 = "O" And Label5 = "O" And Label9 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label4 = "O" And Label5 = "O" And Label6 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label7 = "O" And Label8 = "O" And Label9 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label7 = "O" And Label5 = "O" And Label3 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label2 = "O" And Label5 = "O" And Label8 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label3 = "O" And Label6 = "O" And Label9 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If


If Label1 <> "" And Label2 <> "" And Label3 <> "" And Label4 <> "" And Label5 <> "" And Label6 <> "" And Label7 <> "" And Label8 <> "" And Label9 <> "" And winner = False Then
MsgBox "The Game is a Tie!"
End If
End Sub

Private Sub Label3_Click()
If player = True Then
    If Label3.Caption = "" Then
        Label3.Caption = "X"
        player = False
    End If
    If Label3.Caption = "O" Then
        MsgBox "Illegal Move"
    End If

Else
    If Label3.Caption = "" Then
        Label3.Caption = "O"
        player = True
    End If
    If Label3.Caption = "X" Then
        MsgBox "Illegal Move"
    End If

End If
If Label1 = "X" And Label2 = "X" And Label3 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label1 = "X" And Label4 = "X" And Label7 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label1 = "X" And Label5 = "X" And Label9 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label4 = "X" And Label5 = "X" And Label6 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label7 = "X" And Label8 = "X" And Label9 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label7 = "X" And Label5 = "X" And Label3 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label2 = "X" And Label5 = "X" And Label8 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label3 = "X" And Label6 = "X" And Label9 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If

If Label1 = "O" And Label2 = "O" And Label3 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label1 = "O" And Label4 = "O" And Label7 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label1 = "O" And Label5 = "O" And Label9 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label4 = "O" And Label5 = "O" And Label6 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label7 = "O" And Label8 = "O" And Label9 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label7 = "O" And Label5 = "O" And Label3 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label2 = "O" And Label5 = "O" And Label8 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label3 = "O" And Label6 = "O" And Label9 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If


If Label1 <> "" And Label2 <> "" And Label3 <> "" And Label4 <> "" And Label5 <> "" And Label6 <> "" And Label7 <> "" And Label8 <> "" And Label9 <> "" And winner = False Then
MsgBox "The Game is a Tie!"
End If
End Sub

Private Sub Label4_Click()
If player = True Then
    If Label4.Caption = "" Then
        Label4.Caption = "X"
        player = False
    End If
    If Label4.Caption = "O" Then
        MsgBox "Illegal Move"
    End If

Else
    If Label4.Caption = "" Then
        Label4.Caption = "O"
        player = True
    End If
    If Label4.Caption = "X" Then
        MsgBox "Illegal Move"
    End If

End If
If Label1 = "X" And Label2 = "X" And Label3 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label1 = "X" And Label4 = "X" And Label7 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label1 = "X" And Label5 = "X" And Label9 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label4 = "X" And Label5 = "X" And Label6 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label7 = "X" And Label8 = "X" And Label9 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label7 = "X" And Label5 = "X" And Label3 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label2 = "X" And Label5 = "X" And Label8 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label3 = "X" And Label6 = "X" And Label9 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If

If Label1 = "O" And Label2 = "O" And Label3 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label1 = "O" And Label4 = "O" And Label7 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label1 = "O" And Label5 = "O" And Label9 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label4 = "O" And Label5 = "O" And Label6 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label7 = "O" And Label8 = "O" And Label9 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label7 = "O" And Label5 = "O" And Label3 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label2 = "O" And Label5 = "O" And Label8 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label3 = "O" And Label6 = "O" And Label9 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If


If Label1 <> "" And Label2 <> "" And Label3 <> "" And Label4 <> "" And Label5 <> "" And Label6 <> "" And Label7 <> "" And Label8 <> "" And Label9 <> "" And winner = False Then
MsgBox "The Game is a Tie!"
End If
End Sub

Private Sub Label5_Click()
If player = True Then
    If Label5.Caption = "" Then
        Label5.Caption = "X"
        player = False
    End If
    If Label5.Caption = "O" Then
        MsgBox "Illegal Move"
    End If

Else
    If Label5.Caption = "" Then
        Label5.Caption = "O"
        player = True
    End If
    If Label5.Caption = "X" Then
        MsgBox "Illegal Move"
    End If

End If
If Label1 = "X" And Label2 = "X" And Label3 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label1 = "X" And Label4 = "X" And Label7 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label1 = "X" And Label5 = "X" And Label9 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label4 = "X" And Label5 = "X" And Label6 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label7 = "X" And Label8 = "X" And Label9 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label7 = "X" And Label5 = "X" And Label3 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label2 = "X" And Label5 = "X" And Label8 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label3 = "X" And Label6 = "X" And Label9 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If

If Label1 = "O" And Label2 = "O" And Label3 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label1 = "O" And Label4 = "O" And Label7 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label1 = "O" And Label5 = "O" And Label9 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label4 = "O" And Label5 = "O" And Label6 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label7 = "O" And Label8 = "O" And Label9 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label7 = "O" And Label5 = "O" And Label3 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label2 = "O" And Label5 = "O" And Label8 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label3 = "O" And Label6 = "O" And Label9 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If


If Label1 <> "" And Label2 <> "" And Label3 <> "" And Label4 <> "" And Label5 <> "" And Label6 <> "" And Label7 <> "" And Label8 <> "" And Label9 <> "" And winner = False Then
MsgBox "The Game is a Tie!"
End If
End Sub

Private Sub Label6_Click()
If player = True Then
    If Label6.Caption = "" Then
        Label6.Caption = "X"
        player = False
    End If
    If Label6.Caption = "O" Then
        MsgBox "Illegal Move"
    End If

Else
    If Label6.Caption = "" Then
        Label6.Caption = "O"
        player = True
    End If
    If Label6.Caption = "X" Then
        MsgBox "Illegal Move"
    End If

End If
If Label1 = "X" And Label2 = "X" And Label3 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label1 = "X" And Label4 = "X" And Label7 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label1 = "X" And Label5 = "X" And Label9 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label4 = "X" And Label5 = "X" And Label6 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label7 = "X" And Label8 = "X" And Label9 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label7 = "X" And Label5 = "X" And Label3 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label2 = "X" And Label5 = "X" And Label8 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label3 = "X" And Label6 = "X" And Label9 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If

If Label1 = "O" And Label2 = "O" And Label3 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label1 = "O" And Label4 = "O" And Label7 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label1 = "O" And Label5 = "O" And Label9 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label4 = "O" And Label5 = "O" And Label6 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label7 = "O" And Label8 = "O" And Label9 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label7 = "O" And Label5 = "O" And Label3 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label2 = "O" And Label5 = "O" And Label8 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label3 = "O" And Label6 = "O" And Label9 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If


If Label1 <> "" And Label2 <> "" And Label3 <> "" And Label4 <> "" And Label5 <> "" And Label6 <> "" And Label7 <> "" And Label8 <> "" And Label9 <> "" And winner = False Then
MsgBox "The Game is a Tie!"
End If
End Sub

Private Sub Label7_Click()
If player = True Then
    If Label7.Caption = "" Then
        Label7.Caption = "X"
        player = False
    End If
    If Label7.Caption = "O" Then
        MsgBox "Illegal Move"
    End If

Else
    If Label7.Caption = "" Then
        Label7.Caption = "O"
        player = True
    End If
    If Label7.Caption = "X" Then
        MsgBox "Illegal Move"
    End If

End If
If Label1 = "X" And Label2 = "X" And Label3 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label1 = "X" And Label4 = "X" And Label7 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label1 = "X" And Label5 = "X" And Label9 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label4 = "X" And Label5 = "X" And Label6 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label7 = "X" And Label8 = "X" And Label9 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label7 = "X" And Label5 = "X" And Label3 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label2 = "X" And Label5 = "X" And Label8 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label3 = "X" And Label6 = "X" And Label9 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If

If Label1 = "O" And Label2 = "O" And Label3 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label1 = "O" And Label4 = "O" And Label7 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label1 = "O" And Label5 = "O" And Label9 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label4 = "O" And Label5 = "O" And Label6 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label7 = "O" And Label8 = "O" And Label9 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label7 = "O" And Label5 = "O" And Label3 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label2 = "O" And Label5 = "O" And Label8 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label3 = "O" And Label6 = "O" And Label9 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If


If Label1 <> "" And Label2 <> "" And Label3 <> "" And Label4 <> "" And Label5 <> "" And Label6 <> "" And Label7 <> "" And Label8 <> "" And Label9 <> "" And winner = False Then
MsgBox "The Game is a Tie!"
End If
End Sub

Private Sub Label8_Click()
If player = True Then
    If Label8.Caption = "" Then
        Label8.Caption = "X"
        player = False
    End If
    If Label8.Caption = "O" Then
        MsgBox "Illegal Move"
    End If

Else
    If Label8.Caption = "" Then
        Label8.Caption = "O"
        player = True
    End If
    If Label8.Caption = "X" Then
        MsgBox "Illegal Move"
    End If

End If
If Label1 = "X" And Label2 = "X" And Label3 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label1 = "X" And Label4 = "X" And Label7 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label1 = "X" And Label5 = "X" And Label9 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label4 = "X" And Label5 = "X" And Label6 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label7 = "X" And Label8 = "X" And Label9 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label7 = "X" And Label5 = "X" And Label3 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label2 = "X" And Label5 = "X" And Label8 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label3 = "X" And Label6 = "X" And Label9 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If

If Label1 = "O" And Label2 = "O" And Label3 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label1 = "O" And Label4 = "O" And Label7 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label1 = "O" And Label5 = "O" And Label9 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label4 = "O" And Label5 = "O" And Label6 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label7 = "O" And Label8 = "O" And Label9 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label7 = "O" And Label5 = "O" And Label3 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label2 = "O" And Label5 = "O" And Label8 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label3 = "O" And Label6 = "O" And Label9 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If


If Label1 <> "" And Label2 <> "" And Label3 <> "" And Label4 <> "" And Label5 <> "" And Label6 <> "" And Label7 <> "" And Label8 <> "" And Label9 <> "" And winner = False Then
MsgBox "The Game is a Tie!"
End If
End Sub

Private Sub Label9_Click()
If player = True Then
    If Label9.Caption = "" Then
        Label9.Caption = "X"
        player = False
    End If
    If Label9.Caption = "O" Then
        MsgBox "Illegal Move"
    End If

Else
    If Label9.Caption = "" Then
        Label9.Caption = "O"
        player = True
    End If
    If Label9.Caption = "X" Then
        MsgBox "Illegal Move"
    End If

End If
If Label1 = "X" And Label2 = "X" And Label3 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label1 = "X" And Label4 = "X" And Label7 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label1 = "X" And Label5 = "X" And Label9 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label4 = "X" And Label5 = "X" And Label6 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label7 = "X" And Label8 = "X" And Label9 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label7 = "X" And Label5 = "X" And Label3 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label2 = "X" And Label5 = "X" And Label8 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If
If Label3 = "X" And Label6 = "X" And Label9 = "X" Then
MsgBox "The Winner is X!"
winner = True
End If

If Label1 = "O" And Label2 = "O" And Label3 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label1 = "O" And Label4 = "O" And Label7 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label1 = "O" And Label5 = "O" And Label9 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label4 = "O" And Label5 = "O" And Label6 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label7 = "O" And Label8 = "O" And Label9 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label7 = "O" And Label5 = "O" And Label3 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label2 = "O" And Label5 = "O" And Label8 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If
If Label3 = "O" And Label6 = "O" And Label9 = "O" Then
MsgBox "The Winner is O!"
winner = True
End If


If Label1 <> "" And Label2 <> "" And Label3 <> "" And Label4 <> "" And Label5 <> "" And Label6 <> "" And Label7 <> "" And Label8 <> "" And Label9 <> "" And winner = False Then
MsgBox "The Game is a Tie!"
End If
End Sub

Private Sub quit_Click()
Unload Me
'Shawn's easier to understand version of Tic-Tac-Toe
End Sub
