===============================
Step 9
===============================
Win Settings:
Double Click Timer 1, and put all of this
Code:
If Label12.Text = "X" And Label7.Text = "X" And Label11.Text = "X" Then
Label4.Text = "X"
Label12.Text = ""
Label7.Text = ""
Label11.Text = ""
Label9.Text = ""
Label8.Text = ""
Label13.Text = ""
Label5.Text = ""
Label6.Text = ""
Label10.Text = ""
Button5.Visible = True
Button6.Visible = True
Button9.Visible = True
Button8.Visible = True
Button4.Visible = True
Button3.Visible = True
Button2.Visible = True
Button1.Visible = True
Button7.Visible = True
MsgBox("Player X Won")
End If
If Label12.Text = "X" And Label13.Text = "X" And Label5.Text = "X" Then
Label4.Text = "X"
Label12.Text = ""
Label7.Text = ""
Label11.Text = ""
Label9.Text = ""
Label8.Text = ""
Label13.Text = ""
Label5.Text = ""
Label6.Text = ""
Label10.Text = ""
Button5.Visible = True
Button6.Visible = True
Button9.Visible = True
Button8.Visible = True
Button4.Visible = True
Button3.Visible = True
Button2.Visible = True
Button1.Visible = True
Button7.Visible = True
MsgBox("Player X Won")
End If
If Label7.Text = "X" And Label8.Text = "X" And Label6.Text = "X" Then
Label4.Text = "X"
Label12.Text = ""
Label7.Text = ""
Label11.Text = ""
Label9.Text = ""
Label8.Text = ""
Label13.Text = ""
Label5.Text = ""
Label6.Text = ""
Label10.Text = ""
Button5.Visible = True
Button6.Visible = True
Button9.Visible = True
Button8.Visible = True
Button4.Visible = True
Button3.Visible = True
Button2.Visible = True
Button1.Visible = True
Button7.Visible = True
MsgBox("Player X Won")
End If
If Label11.Text = "X" And Label9.Text = "X" And Label10.Text = "X" Then
Label4.Text = "X"
Label12.Text = ""
Label7.Text = ""
Label11.Text = ""
Label9.Text = ""
Label8.Text = ""
Label13.Text = ""
Label5.Text = ""
Label6.Text = ""
Label10.Text = ""
Button5.Visible = True
Button6.Visible = True
Button9.Visible = True
Button8.Visible = True
Button4.Visible = True
Button3.Visible = True
Button2.Visible = True
Button1.Visible = True
Button7.Visible = True
MsgBox("Player X Won")
End If
If Label13.Text = "X" And Label8.Text = "X" And Label9.Text = "X" Then
Label4.Text = "X"
Label12.Text = ""
Label7.Text = ""
Label11.Text = ""
Label9.Text = ""
Label8.Text = ""
Label13.Text = ""
Label5.Text = ""
Label6.Text = ""
Label10.Text = ""
Button5.Visible = True
Button6.Visible = True
Button9.Visible = True
Button8.Visible = True
Button4.Visible = True
Button3.Visible = True
Button2.Visible = True
Button1.Visible = True
Button7.Visible = True
MsgBox("Player X Won")
End If
If Label5.Text = "X" And Label6.Text = "X" And Label10.Text = "X" Then
Label4.Text = "X"
Label12.Text = ""
Label7.Text = ""
Label11.Text = ""
Label9.Text = ""
Label8.Text = ""
Label13.Text = ""
Label5.Text = ""
Label6.Text = ""
Label10.Text = ""
Button5.Visible = True
Button6.Visible = True
Button9.Visible = True
Button8.Visible = True
Button4.Visible = True
Button3.Visible = True
Button2.Visible = True
Button1.Visible = True
Button7.Visible = True
MsgBox("Player X Won")
End If
If Label12.Text = "O" And Label7.Text = "O" And Label11.Text = "O" Then
Label4.Text = "X"
Label12.Text = ""
Label7.Text = ""
Label11.Text = ""
Label9.Text = ""
Label8.Text = ""
Label13.Text = ""
Label5.Text = ""
Label6.Text = ""
Label10.Text = ""
Button5.Visible = True
Button6.Visible = True
Button9.Visible = True
Button8.Visible = True
Button4.Visible = True
Button3.Visible = True
Button2.Visible = True
Button1.Visible = True
Button7.Visible = True
MsgBox("Player O Won")
End If
If Label12.Text = "O" And Label13.Text = "O" And Label5.Text = "O" Then
Label4.Text = "X"
Label12.Text = ""
Label7.Text = ""
Label11.Text = ""
Label9.Text = ""
Label8.Text = ""
Label13.Text = ""
Label5.Text = ""
Label6.Text = ""
Label10.Text = ""
Button5.Visible = True
Button6.Visible = True
Button9.Visible = True
Button8.Visible = True
Button4.Visible = True
Button3.Visible = True
Button2.Visible = True
Button1.Visible = True
Button7.Visible = True
MsgBox("Player O Won")
End If
If Label7.Text = "O" And Label8.Text = "O" And Label6.Text = "O" Then
Label4.Text = "X"
Label12.Text = ""
Label7.Text = ""
Label11.Text = ""
Label9.Text = ""
Label8.Text = ""
Label13.Text = ""
Label5.Text = ""
Label6.Text = ""
Label10.Text = ""
Button5.Visible = True
Button6.Visible = True
Button9.Visible = True
Button8.Visible = True
Button4.Visible = True
Button3.Visible = True
Button2.Visible = True
Button1.Visible = True
Button7.Visible = True
MsgBox("Player O Won")
End If
If Label11.Text = "O" And Label9.Text = "O" And Label10.Text = "O" Then
Label4.Text = "X"
Label12.Text = ""
Label7.Text = ""
Label11.Text = ""
Label9.Text = ""
Label8.Text = ""
Label13.Text = ""
Label5.Text = ""
Label6.Text = ""
Label10.Text = ""
Button5.Visible = True
Button6.Visible = True
Button9.Visible = True
Button8.Visible = True
Button4.Visible = True
Button3.Visible = True
Button2.Visible = True
Button1.Visible = True
Button7.Visible = True
MsgBox("Player O Won")
End If
If Label13.Text = "O" And Label8.Text = "O" And Label9.Text = "O" Then
Label4.Text = "X"
Label12.Text = ""
Label7.Text = ""
Label11.Text = ""
Label9.Text = ""
Label8.Text = ""
Label13.Text = ""
Label5.Text = ""
Label6.Text = ""
Label10.Text = ""
Button5.Visible = True
Button6.Visible = True
Button9.Visible = True
Button8.Visible = True
Button4.Visible = True
Button3.Visible = True
Button2.Visible = True
Button1.Visible = True
Button7.Visible = True
MsgBox("Player O Won")
End If
If Label5.Text = "O" And Label6.Text = "O" And Label10.Text = "O" Then
Label4.Text = "X"
Label12.Text = ""
Label7.Text = ""
Label11.Text = ""
Label9.Text = ""
Label8.Text = ""
Label13.Text = ""
Label5.Text = ""
Label6.Text = ""
Label10.Text = ""
Button5.Visible = True
Button6.Visible = True
Button9.Visible = True
Button8.Visible = True
Button4.Visible = True
Button3.Visible = True
Button2.Visible = True
Button1.Visible = True
Button7.Visible = True
MsgBox("Player O Won")
End If
If Label12.Text = "O" And Label8.Text = "O" And Label10.Text = "O" Then
Label4.Text = "X"
Label12.Text = ""
Label7.Text = ""
Label11.Text = ""
Label9.Text = ""
Label8.Text = ""
Label13.Text = ""
Label5.Text = ""
Label6.Text = ""
Label10.Text = ""
Button5.Visible = True
Button6.Visible = True
Button9.Visible = True
Button8.Visible = True
Button4.Visible = True
Button3.Visible = True
Button2.Visible = True
Button1.Visible = True
Button7.Visible = True
MsgBox("Player O Won")
End If
If Label5.Text = "O" And Label8.Text = "O" And Label11.Text = "O" Then
Label4.Text = "X"
Label12.Text = ""
Label7.Text = ""
Label11.Text = ""
Label9.Text = ""
Label8.Text = ""
Label13.Text = ""
Label5.Text = ""
Label6.Text = ""
Label10.Text = ""
Button5.Visible = True
Button6.Visible = True
Button9.Visible = True
Button8.Visible = True
Button4.Visible = True
Button3.Visible = True
Button2.Visible = True
Button1.Visible = True
Button7.Visible = True
MsgBox("Player O Won")
End If
If Label12.Text = "X" And Label8.Text = "X" And Label10.Text = "X" Then
Label4.Text = "X"
Label12.Text = ""
Label7.Text = ""
Label11.Text = ""
Label9.Text = ""
Label8.Text = ""
Label13.Text = ""
Label5.Text = ""
Label6.Text = ""
Label10.Text = ""
Button5.Visible = True
Button6.Visible = True
Button9.Visible = True
Button8.Visible = True
Button4.Visible = True
Button3.Visible = True
Button2.Visible = True
Button1.Visible = True
Button7.Visible = True
MsgBox("Player X Won")
End If
If Label5.Text = "X" And Label8.Text = "X" And Label11.Text = "X" Then
Label4.Text = "X"
Label12.Text = ""
Label7.Text = ""
Label11.Text = ""
Label9.Text = ""
Label8.Text = ""
Label13.Text = ""
Label5.Text = ""
Label6.Text = ""
Label10.Text = ""
Button5.Visible = True
Button6.Visible = True
Button9.Visible = True
Button8.Visible = True
Button4.Visible = True
Button3.Visible = True
Button2.Visible = True
Button1.Visible = True
Button7.Visible = True
MsgBox("Player X Won")
End If
Try To figure That out yourself (just read the coding)if you have trouble ask me below in comments
===============================
Step 10
===============================
Double Click your Checkbox;
Put this:
Timer2.Enabled = True
That turns Timer 2 on when checked
===============================
Step 11
===============================
Ok Now this is the Computer Setting:
Change properties on Timer to Enabled False and interval 1
Double Click Timer 2
Put This Long Code in i will explain after:
A:
Dim rndnumber As Random
Dim number As Integer
rndnumber = New Random
number = rndnumber.Next(1, 9)
If Label4.Text = "O" Then
Button5.Visible = False
Button6.Visible = False
Button9.Visible = False
Button8.Visible = False
Button4.Visible = False
Button3.Visible = False
Button2.Visible = False
Button1.Visible = False
Button7.Visible = False
Else
Button5.Visible = True
Button6.Visible = True
Button9.Visible = True
Button8.Visible = True
Button4.Visible = True
Button3.Visible = True
Button2.Visible = True
Button1.Visible = True
Button7.Visible = True
End If
If number = 1 And Label4.Text = "O" And Label10.Text = "" Then
Label10.Text = "O"
Label4.Text = "X"
GoTo A
End If
If number = 2 And Label4.Text = "O" And Label6.Text = "" Then
Label6.Text = "O"
Label4.Text = "X"
GoTo A
End If
If number = 3 And Label4.Text = "O" And Label5.Text = "" Then
Label5.Text = "O"
Label4.Text = "X"
GoTo A
End If
If number = 4 And Label4.Text = "O" And Label9.Text = "" Then
Label9.Text = "O"
Label4.Text = "X"
GoTo A
End If
If number = 5 And Label4.Text = "O" And Label8.Text = "" Then
Label8.Text = "O"
Label4.Text = "X"
GoTo A
End If
If number = 6 And Label4.Text = "O" And Label13.Text = "" Then
Label13.Text = "O"
Label4.Text = "X"
GoTo A
End If
If number = 7 And Label4.Text = "O" And Label11.Text = "" Then
Label11.Text = "O"
Label4.Text = "X"
GoTo A
End If
If number = 8 And Label4.Text = "O" And Label7.Text = "" Then
Label7.Text = "O"
Label4.Text = "X"
GoTo A
End If
If number = 9 And Label4.Text = "O" And Label12.Text = "" Then
Label12.Text = "O"
Label4.Text = "X"
GoTo A
End If
Ok What we just did was make a point in the coding (A) so that the code will loop and not just go once.
Ok then we made a Random Number Generator, Dim rndnumber As Random
Dim number As Integer
rndnumber = New Random
number = rndnumber.Next(1, 9)
Number is a Variable that held the value of the Random number We then made an if then statement for each number posibilities and assinged each number to a label basically that way it will change the text of the label its attached to if it is O's turn and the label has not been changed already
===============================
Step 12
===============================
Ok we are almost done double click timer3
Properties of timer 3 are Interval 1, Enabled True
Coding:
If CheckBox1.Checked = False Then
Timer2.Enabled = False
End If
This means that if the cumputer checkbox is unchecked it will go back to player vs player
it does this by disabling timer 2
===============================
Step 13
===============================
Change all buttons to flat (except Play Again button)
the flat properties and put border size to 0 then remove the text from them
This makes the buttons invisible
===============================
Tutorial By: KodeKing
Do Not redistribute This Tutorial
Video Tutorial will be up when i get a new mic
Post Questions Comments and Concerns below