烙饼卷米饭吧 关注:44贴子:922
  • 3回复贴,共1
Private Sub Buttons(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click, Button2.Click, Button3.Click, Button4.Click, Button5.Click, Button6.Click, Button7.Click, Button8.Click, Button9.Click
If flag = False Then
DirectCast(sender, Button).Text = "x"
flag = True
Else
DirectCast(sender, Button).Text = "O"
flag = False
End If
win()
End Sub
Private Sub win()
If Button1.Text = "x" And Button2.Text = "x" And Button3.Text = "x" Then
MsgBox("player X win", MsgBoxStyle.Information)
Label3.Text += 1
Button1.Text = ""
Button2.Text = ""
Button3.Text = ""
Button4.Text = ""
Button5.Text = ""
Button6.Text = ""
Button7.Text = ""
Button8.Text = ""
Button9.Text = ""
End If
If Button1.Text = "x" And Button4.Text = "x" And Button7.Text = "x" Then
Label3.Text += 1
MsgBox("player X win", MsgBoxStyle.Information)
Button1.Text = ""
Button2.Text = ""
Button3.Text = ""
Button4.Text = ""
Button5.Text = ""
Button6.Text = ""
Button7.Text = ""
Button8.Text = ""
Button9.Text = ""
End If
If Button1.Text = "x" And Button5.Text = "x" And Button9.Text = "x" Then
Label3.Text += 1
MsgBox("player X win", MsgBoxStyle.Information)
Button1.Text = ""
Button2.Text = ""
Button3.Text = ""
Button4.Text = ""
Button5.Text = ""
Button6.Text = ""
Button7.Text = ""
Button8.Text = ""
Button9.Text = ""
End If
If Button2.Text = "x" And Button5.Text = "x" And Button8.Text = "x" Then
Label3.Text += 1
MsgBox("player X win", MsgBoxStyle.Information)
Button1.Text = ""
Button2.Text = ""
Button3.Text = ""
Button4.Text = ""
Button5.Text = ""
Button6.Text = ""
Button7.Text = ""
Button8.Text = ""
Button9.Text = ""
End If
If Button3.Text = "x" And Button6.Text = "x" And Button9.Text = "x" Then
Label3.Text += 1
MsgBox("player X win", MsgBoxStyle.Information)
Button1.Text = ""
Button2.Text = ""
Button3.Text = ""
Button4.Text = ""
Button5.Text = ""
Button6.Text = ""
Button7.Text = ""
Button8.Text = ""
End If
If Button3.Text = "x" And Button5.Text = "x" And Button7.Text = "x" Then


IP属地:北京1楼2012-12-04 07:34回复
    Label3.Text += 1
    MsgBox("player X win", MsgBoxStyle.Information)
    Button1.Text = ""
    Button2.Text = ""
    Button3.Text = ""
    Button4.Text = ""
    Button5.Text = ""
    Button6.Text = ""
    Button7.Text = ""
    Button8.Text = ""
    End If
    If Button4.Text = "x" And Button5.Text = "x" And Button6.Text = "x" Then
    Label3.Text += 1
    MsgBox("player X win", MsgBoxStyle.Information)
    Button1.Text = ""
    Button2.Text = ""
    Button3.Text = ""
    Button4.Text = ""
    Button5.Text = ""
    Button6.Text = ""
    Button7.Text = ""
    Button8.Text = ""
    End If
    If Button7.Text = "x" And Button8.Text = "x" And Button9.Text = "x" Then
    Label3.Text += 1
    MsgBox("player X win", MsgBoxStyle.Information)
    Button1.Text = ""
    Button2.Text = ""
    Button3.Text = ""
    Button4.Text = ""
    Button5.Text = ""
    Button6.Text = ""
    Button7.Text = ""
    Button8.Text = ""
    End If
    'ABOUT O
    If Button1.Text = "O" And Button2.Text = "O" And Button3.Text = "O" Then
    Label5.Text += 1
    MsgBox("player O win", MsgBoxStyle.Information)
    Button1.Text = ""
    Button2.Text = ""
    Button3.Text = ""
    Button4.Text = ""
    Button5.Text = ""
    Button6.Text = ""
    Button7.Text = ""
    Button8.Text = ""
    Button9.Text = ""
    End If
    If Button1.Text = "O" And Button4.Text = "O" And Button7.Text = "O" Then
    Label5.Text += 1
    MsgBox("player O win", MsgBoxStyle.Information)
    Button1.Text = ""
    Button2.Text = ""
    Button3.Text = ""
    Button4.Text = ""
    Button5.Text = ""
    Button6.Text = ""
    Button7.Text = ""
    Button8.Text = ""
    Button9.Text = ""
    End If
    If Button1.Text = "O" And Button5.Text = "O" And Button9.Text = "O" Then
    Label5.Text += 1
    MsgBox("player O win", MsgBoxStyle.Information)
    Button1.Text = ""
    Button2.Text = ""
    Button3.Text = ""
    Button4.Text = ""
    Button5.Text = ""
    Button6.Text = ""
    Button7.Text = ""
    Button8.Text = ""
    Button9.Text = ""
    End If
    If Button2.Text = "O" And Button5.Text = "O" And Button8.Text = "O" Then
    Label5.Text += 1
    MsgBox("player O win", MsgBoxStyle.Information)
    Button1.Text = ""


    IP属地:北京2楼2012-12-04 07:34
    回复
      广告
      立即查看
      Button2.Text = ""
      Button3.Text = ""
      Button4.Text = ""
      Button5.Text = ""
      Button6.Text = ""
      Button7.Text = ""
      Button8.Text = ""
      Button9.Text = ""
      End If
      If Button3.Text = "O" And Button6.Text = "O" And Button9.Text = "O" Then
      Label5.Text += 1
      MsgBox("player O win", MsgBoxStyle.Information)
      Button1.Text = ""
      Button2.Text = ""
      Button3.Text = ""
      Button4.Text = ""
      Button5.Text = ""
      Button6.Text = ""
      Button7.Text = ""
      Button8.Text = ""
      End If
      If Button3.Text = "O" And Button5.Text = "O" And Button7.Text = "O" Then
      Label5.Text += 1
      MsgBox("player O win", MsgBoxStyle.Information)
      Button1.Text = ""
      Button2.Text = ""
      Button3.Text = ""
      Button4.Text = ""
      Button5.Text = ""
      Button6.Text = ""
      Button7.Text = ""
      Button8.Text = ""
      End If
      If Button4.Text = "O" And Button5.Text = "O" And Button6.Text = "O" Then
      Label5.Text += 1
      MsgBox("player O win", MsgBoxStyle.Information)
      Button1.Text = ""
      Button2.Text = ""
      Button3.Text = ""
      Button4.Text = ""
      Button5.Text = ""
      Button6.Text = ""
      Button7.Text = ""
      Button8.Text = ""
      End If
      If Button7.Text = "O" And Button8.Text = "O" And Button9.Text = "O" Then
      Label5.Text += 1
      MsgBox("player O win", MsgBoxStyle.Information)
      Button1.Text = ""
      Button2.Text = ""
      Button3.Text = ""
      Button4.Text = ""
      Button5.Text = ""
      Button6.Text = ""
      Button7.Text = ""
      Button8.Text = ""
      End If
      End Sub Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
      Button1.Text = ""
      Button2.Text = ""
      Button3.Text = ""
      Button4.Text = ""
      Button5.Text = ""
      Button6.Text = ""
      Button7.Text = ""
      Button8.Text = ""
      Button9.Text = ""
      End Sub Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
      Label3.Text = "0"
      Label5.Text = "0"
      End Sub


      IP属地:北京3楼2012-12-04 07:34
      回复
        目测是编程。


        IP属地:加拿大4楼2012-12-05 04:48
        回复