Click here to Skip to main content
15,902,893 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
VB
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        RadioButton1.Checked = True
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If RadioButton1.Checked = True Then
            Button1.Text = "X"
        Else
            Button1.Text = "O"
        End If
        Button1.Enabled = False
        If Button1.Text = "X" And Button2.Text = "X" And Button3.Text = "X" Then
            MsgBox("You win Player")
            Label3.Text += 1
            Button1.Text = ""
            Button2.Text = ""
            Button3.Text = ""
            Button1.Enabled = True
            Button2.Enabled = True
            Button3.Enabled = True
        End If
        If Button1.Text = "X" And Button4.Text = "X" And Button7.Text = "X" Then
            MsgBox("EDERES PLAYER !!!")
            Label3.Text += 1
            Button1.Text = ""
            Button4.Text = ""
            Button7.Text = ""
            Button1.Enabled = True
            Button4.Enabled = True
            Button7.Enabled = True
        End If
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        If RadioButton1.Checked = True Then
            Button2.Text = "X"
        Else
            Button1.Text = "O"
        End If
        Button2.Enabled = False
        If Button1.Text = "X" And Button2.Text = "X" And Button3.Text = "X" Then
            MsgBox("You win Player")
            Label3.Text += 1
            Button1.Text = ""
            Button2.Text = ""
            Button3.Text = ""
            Button1.Enabled = False
            Button2.Enabled = False
            Button3.Enabled = False

        End If

        If RadioButton1.Checked = True Then
            Button2.Text = "X"
        Else
            Button5.Text = "O"

        End If
        Button1.Enabled = False
        If Button2.Text = "X" And Button5.Text = "X" And Button8.Text = "X" Then
            MsgBox("EDERES PLAYER !!!")
            Label3.Text += 1
            Button2.Text = ""
            Button5.Text = ""
            Button8.Text = ""
            Button2.Enabled = True
            Button5.Enabled = True
            Button8.Enabled = True
        End If

    End Sub

    Private Sub RESTARTToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Button1.Text = ""
        Button2.Text = ""
        Button3.Text = ""
        Button4.Text = ""
        Button5.Text = ""
        Button8.Text = ""
        Button1.Enabled = True
        Button2.Enabled = True
        Button3.Enabled = True
        Button4.Enabled = True
        Button5.Enabled = True
        Button8.Enabled = True



    End Sub

    Private Sub PINKPATNTHERToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PINKPATNTHERToolStripMenuItem.Click
        ' Me.BackgroundImage = Image.FromFile(Path)
        ' Me.BackgroundImage.Size = BackgroundImageLayout.Stretch()
        ' Button1.BackColor =

    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        If RadioButton1.Checked = True Then
            Button3.Text = "X"
        Else
            Button3.Text = "O"
        End If
        Button3.Enabled = False
        If Button1.Text = "X" And Button2.Text = "X" And Button3.Text = "X" Then
            MsgBox("EDERES PLAYER !!!")
            Button1.Text = ""
            Button2.Text = ""
            Button3.Text = ""
            Button1.Enabled = True
            Button2.Enabled = True
            Button3.Enabled = True
            Label3.Text += 1
        End If
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        If RadioButton1.Checked = True Then
            Button4.Text = "X"
        Else
            Button4.Text = "O"
        End If
        Button4.Enabled = False
        If Button1.Text = "X" And Button4.Text = "X" And Button7.Text = "X" Then
            MsgBox("EDERES PLAYER !!!")
            Label3.Text += 1
            Button2.Text = ""
            Button4.Text = ""
            Button7.Text = ""
            Button1.Enabled = False
            Button4.Enabled = False
            Button7.Enabled = False

        End If
    End Sub

    Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
        If RadioButton1.Checked = True Then
            Button7.Text = "X"
        Else
            Button7.Text = "O"
        End If
        Button1.Enabled = False
        If Button1.Text = "X" And Button4.Text = "X" And Button7.Text = "X" Then
            MsgBox("EDERES PLAYER !!!")
            Label3.Text += 1
            Button1.Text = ""
            Button4.Text = ""
            Button7.Text = ""
            Button1.Enabled = True
            Button4.Enabled = True
            Button7.Enabled = True
        End If
    End Sub

    Private Sub MenuStrip1_ItemClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles MenuStrip1.ItemClicked

    End Sub

    Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
        Me.Close()

    End Sub

    Private Sub HELPToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HELPToolStripMenuItem.Click

    End Sub

    Private Sub ABOUTToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ABOUTToolStripMenuItem.Click
        MsgBox("Tic Tac Toe V1.0")
    End Sub

    Private Sub HELPToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HELPToolStripMenuItem1.Click
        MsgBox("O kathe xristis prepei na feri 3 X h 3 O gia na kerdisi")

    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        If RadioButton1.Checked = True Then
            Button5.Text = "X"
        Else
            Button5.Text = "O"
        End If
        Button5.Enabled = False
        If Button2.Text = "X" And Button5.Text = "X" And Button8.Text = "X" Then
            MsgBox(" you win PLAYER !!!")
            Label3.Text += 1
            Button2.Text = ""
            Button5.Text = ""
            Button8.Text = ""
            Button2.Enabled = False
            Button5.Enabled = False
            Button8.Enabled = False


        End If
    End Sub

    Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
        If RadioButton1.Checked = True Then
            Button8.Text = "X"
        Else
            Button8.Text = "O"
        End If
        Button1.Enabled = False
        If Button2.Text = "X" And Button5.Text = "X" And Button8.Text = "X" Then
            MsgBox(" you win PLAYER !!!")
            Label3.Text += 1
            Button2.Text = ""
            Button4.Text = ""
            Button7.Text = ""
            Button1.Enabled = True
            Button4.Enabled = True
            Button7.Enabled = True
        End If
    End Sub
End Class

the problem with i have two player in this game i want a make a basic tic tac toe thanks in andvance!!
this programme will be made in form not in console..
Posted
Updated 1-Nov-13 1:30am
v2
Comments
Andreas Gieriet 1-Nov-13 7:30am    
And the question is?
Cheers
Andi
constantinos 5 1-Nov-13 7:33am    
i need help i don't know how do i have wrong in my code!! :(
Andreas Gieriet 1-Nov-13 7:43am    
Are we supposed to compile and run your code? No way, sorry.
Ask a decent question, e.g. do you have a compilation error? Which?
Andi
Richard MacCutchan 1-Nov-13 7:30am    
What exactly is your problem?

1 solution

please delete this posts thxs!
 
Share this answer
 
Comments
Abhinav Gauniyal 1-Nov-13 7:52am    
Okay , but what happened?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900