Quantcast
Channel: iT邦幫忙
Viewing all articles
Browse latest Browse all 15645

VB 2010 Express 井字遊戲(圈圈叉叉) (白癡板

$
0
0
vb2010Express
我只寫到這裡,發現漏洞應該很多,所以想請教大家怎寫才好,
想問寫法(不要暴力法

Public Class Form1
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
PictureBox1.Enabled = False
PictureBox1.Image = My.Resources.叉叉
If PictureBox1.Enabled = False AndAlso PictureBox2.Enabled = True Then
PictureBox2.Image = My.Resources.圈圈
PictureBox2.Enabled = False
ElseIf PictureBox2.Enabled = False AndAlso PictureBox3.Enabled = True Then
PictureBox3.Image = My.Resources.圈圈
PictureBox3.Enabled = False
End If
End Sub
Private Sub PictureBox2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox2.Click
PictureBox1.Enabled = False
PictureBox1.Image = My.Resources.叉叉
If PictureBox2.Enabled = False AndAlso PictureBox3.Enabled = True Then
PictureBox3.Image = My.Resources.圈圈
PictureBox3.Enabled = False
ElseIf PictureBox2.Enabled = False AndAlso PictureBox3.Enabled = False AndAlso PictureBox4.Enabled = True Then
PictureBox4.Image = My.Resources.圈圈
PictureBox4.Enabled = False
End If
End Sub
Private Sub PictureBox3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox3.Click
PictureBox3.Enabled = False
PictureBox3.Image = My.Resources.叉叉
If PictureBox3.Enabled = False AndAlso PictureBox4.Enabled = True Then
PictureBox4.Image = My.Resources.圈圈
PictureBox4.Enabled = False
ElseIf PictureBox3.Enabled = False AndAlso PictureBox4.Enabled = False AndAlso PictureBox5.Enabled = True Then
PictureBox5.Image = My.Resources.圈圈
PictureBox5.Enabled = False
End If
End Sub

Private Sub PictureBox4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox4.Click
PictureBox4.Enabled = False
PictureBox4.Image = My.Resources.叉叉
If PictureBox4.Enabled = False AndAlso PictureBox5.Enabled = True Then
PictureBox5.Image = My.Resources.圈圈
PictureBox5.Enabled = False
ElseIf PictureBox4.Enabled = False AndAlso PictureBox5.Enabled = False AndAlso PictureBox6.Enabled = True Then
PictureBox6.Image = My.Resources.圈圈
PictureBox6.Enabled = False
End If
End Sub

Private Sub PictureBox5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox5.Click
PictureBox5.Enabled = False
PictureBox5.Image = My.Resources.叉叉
If PictureBox5.Enabled = False AndAlso PictureBox6.Enabled = True Then
PictureBox6.Image = My.Resources.圈圈
PictureBox6.Enabled = False
ElseIf PictureBox5.Enabled = False AndAlso PictureBox6.Enabled = False AndAlso PictureBox7.Enabled = True Then
PictureBox7.Image = My.Resources.圈圈
PictureBox7.Enabled = False
End If
End Sub

Private Sub PictureBox6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox6.Click
PictureBox6.Enabled = False
PictureBox6.Image = My.Resources.叉叉
If PictureBox6.Enabled = False AndAlso PictureBox7.Enabled = True Then
PictureBox7.Image = My.Resources.圈圈
PictureBox7.Enabled = False
ElseIf PictureBox6.Enabled = False AndAlso PictureBox7.Enabled = False AndAlso PictureBox8.Enabled = True Then
PictureBox8.Image = My.Resources.圈圈
PictureBox8.Enabled = False
End If
End Sub

Private Sub PictureBox7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox7.Click
PictureBox7.Enabled = False
PictureBox7.Image = My.Resources.叉叉
If PictureBox7.Enabled = False AndAlso PictureBox8.Enabled = True Then
PictureBox8.Image = My.Resources.圈圈
PictureBox8.Enabled = False
ElseIf PictureBox7.Enabled = False AndAlso PictureBox8.Enabled = False AndAlso PictureBox9.Enabled = True Then
PictureBox9.Image = My.Resources.圈圈
PictureBox9.Enabled = False
End If
End Sub

Private Sub PictureBox8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox8.Click
PictureBox8.Enabled = False
PictureBox8.Image = My.Resources.叉叉
If PictureBox8.Enabled = False AndAlso PictureBox9.Enabled = True Then
PictureBox9.Image = My.Resources.圈圈
PictureBox9.Enabled = False
ElseIf PictureBox8.Enabled = False AndAlso PictureBox9.Enabled = False AndAlso PictureBox1.Enabled = True Then
PictureBox1.Image = My.Resources.圈圈
PictureBox1.Enabled = False
End If
End Sub

Private Sub PictureBox9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox9.Click
PictureBox9.Enabled = False
PictureBox9.Image = My.Resources.叉叉
If PictureBox9.Enabled = False AndAlso PictureBox1.Enabled = True Then
PictureBox1.Image = My.Resources.圈圈
PictureBox1.Enabled = False
ElseIf PictureBox9.Enabled = False AndAlso PictureBox1.Enabled = False AndAlso PictureBox2.Enabled = True Then
PictureBox2.Image = My.Resources.圈圈
PictureBox2.Enabled = False
ElseIf PictureBox9.Enabled = False AndAlso PictureBox1.Enabled = False AndAlso PictureBox2.Enabled = False AndAlso PictureBox3.Enabled = True Then
PictureBox3.Image = My.Resources.圈圈
PictureBox3.Enabled = False
End If
End Sub
End Class

Viewing all articles
Browse latest Browse all 15645

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>