agl3
Usuario (Guatemala)
bueno taringeros este es mi primer post y quiero darles esta finformacion para quienes se pregunten como hacer un totio en vb a qui se los de jo Public Class totito Private Sub victorias() If Button1.Text = "X" And Button2.Text = "X" And Button3.Text = "X" Then MsgBox("el ganador es X" jugadorx = jugadorx + 1 Label4.Text = jugadorx Call apagarbotones() ElseIf Button1.Text = "X" And Button5.Text = "X" And Button9.Text = "X" Then MsgBox("el ganador es X" jugadorx = jugadorx + 1 Label4.Text = jugadorx Call apagarbotones() ElseIf Button1.Text = "X" And Button4.Text = "X" And Button7.Text = "X" Then MsgBox("el ganador es X" jugadorx = jugadorx + 1 Label4.Text = jugadorx Call apagarbotones() ElseIf Button2.Text = "X" And Button5.Text = "X" And Button8.Text = "X" Then MsgBox("el ganador es X" jugadorx = jugadorx + 1 Label4.Text = jugadorx Call apagarbotones() ElseIf Button3.Text = "X" And Button6.Text = "X" And Button9.Text = "X" Then MsgBox("el ganador es X" jugadorx = jugadorx + 1 Label4.Text = jugadorx Call apagarbotones() ElseIf Button3.Text = "X" And Button5.Text = "X" And Button7.Text = "X" Then MsgBox("el ganador es X" jugadorx = jugadorx + 1 Label4.Text = jugadorx Call apagarbotones() ElseIf Button4.Text = "X" And Button5.Text = "X" And Button6.Text = "X" Then MsgBox("el ganador es X" jugadorx = jugadorx + 1 Label4.Text = jugadorx Call apagarbotones() ElseIf Button7.Text = "X" And Button8.Text = "X" And Button9.Text = "X" Then MsgBox("el ganador es X" jugadorx = jugadorx + 1 Label4.Text = jugadorx Call apagarbotones() ElseIf Button1.Text = "0" And Button2.Text = "0" And Button3.Text = "0" Then MsgBox("el ganador es 0" jugadpr0 = jugadpr0 + 1 Label6.Text = jugadpr0 Call apagarbotones() ElseIf Button4.Text = "0" And Button5.Text = "0" And Button6.Text = "0" Then MsgBox("el ganador es 0" jugadpr0 = jugadpr0 + 1 Label6.Text = jugadpr0 Call apagarbotones() ElseIf Button7.Text = "0" And Button8.Text = "0" And Button9.Text = "0" Then MsgBox("el ganador es 0" jugadpr0 = jugadpr0 + 1 Label6.Text = jugadpr0 Call apagarbotones() ElseIf Button1.Text = "0" And Button4.Text = "0" And Button7.Text = "0" Then MsgBox("el ganador es 0" jugadpr0 = jugadpr0 + 1 Label6.Text = jugadpr0 Call apagarbotones() ElseIf Button2.Text = "0" And Button5.Text = "0" And Button8.Text = "0" Then MsgBox("el ganador es 0" jugadpr0 = jugadpr0 + 1 Label6.Text = jugadpr0 Call apagarbotones() ElseIf Button3.Text = "0" And Button6.Text = "0" And Button9.Text = "0" Then MsgBox("el ganador es 0" jugadpr0 = jugadpr0 + 1 Label6.Text = jugadpr0 Call apagarbotones() ElseIf Button1.Text = "0" And Button5.Text = "0" And Button9.Text = "0" Then MsgBox("el ganador es 0" jugadpr0 = jugadpr0 + 1 Label6.Text = jugadpr0 Call apagarbotones() ElseIf Button3.Text = "0" And Button5.Text = "0" And Button9.Text = "0" Then MsgBox("el ganador es 0" jugadpr0 = jugadpr0 + 1 Label6.Text = jugadpr0 Call apagarbotones() End If End Sub Public Sub apagarbotones() Button1.Enabled = False Button2.Enabled = False Button3.Enabled = False Button4.Enabled = False Button5.Enabled = False Button6.Enabled = False Button7.Enabled = False Button8.Enabled = False Button9.Enabled = False End Sub Public Sub nuevojuego() Button1.Text = " " Button1.Enabled = True Button2.Text = "" Button2.Enabled = True Button3.Text = "" Button3.Enabled = True Button4.Text = "" Button4.Enabled = True Button5.Text = "" Button5.Enabled = True Button6.Text = "" Button6.Enabled = True Button7.Text = "" Button7.Enabled = True Button8.Text = "" Button8.Enabled = True Button9.Text = "" Button9.Enabled = True End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If turno = 1 Then Button1.Text = "0" Label2.Text = "X" Else Button1.Text = "X" Label2.Text = "0" End If turno = turno + 1 If turno > 2 Then turno = 1 End If Call victorias() Button1.Enabled = False End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If turno = 1 Then Button2.Text = "0" Label2.Text = "X" Else Button2.Text = "X" Label2.Text = "0" End If turno = turno + 1 If turno > 2 Then turno = 1 End If Call victorias() Button2.Enabled = False End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click If turno = 1 Then Button3.Text = "0" Label2.Text = "X" Else Button3.Text = "X" Label2.Text = "0" End If turno = turno + 1 If turno > 2 Then turno = 1 End If Call victorias() Button3.Enabled = False End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click If turno = 1 Then Button4.Text = "0" Label2.Text = "X" Else Button4.Text = "X" Label2.Text = "0" End If turno = turno + 1 If turno > 2 Then turno = 1 End If Call victorias() Button4.Enabled = False End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click If turno = 1 Then Button5.Text = "0" Label2.Text = "X" Else Button5.Text = "X" Label2.Text = "0" End If turno = turno + 1 If turno > 2 Then turno = 1 End If Call victorias() Button5.Enabled = False End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click If turno = 1 Then Button6.Text = "0" Label2.Text = "X" Else Button6.Text = "X" Label2.Text = "0" End If turno = turno + 1 If turno > 2 Then turno = 1 End If Call victorias() Button6.Enabled = False End Sub Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click If turno = 1 Then Button7.Text = "0" Label2.Text = "X" Else Button7.Text = "X" Label2.Text = "0" End If turno = turno + 1 If turno > 2 Then turno = 1 End If Call victorias() Button7.Enabled = False End Sub Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click If turno = 1 Then Button8.Text = "0" Label2.Text = "x" Else Button8.Text = "X" Label2.Text = "0" End If turno = turno + 1 If turno > 2 Then turno = 1 End If Call victorias() Button8.Enabled = False End Sub Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click If turno = 1 Then Button9.Text = "0" Label2.Text = "X" Else Button9.Text = "X" Label2.Text = "0" End If turno = turno + 1 If turno > 2 Then turno = 1 End If Call victorias() Button9.Enabled = False End Sub Private Sub NuevoJuegoToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NuevoJuegoToolStripMenuItem.Click Call nuevojuego() End Sub Private Sub SalidaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SalidaToolStripMenuItem.Click End End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Label2.Text = "X" jugadorx = 0 jugadpr0 = 0 End Sub