Private Sub Command1_Click()
Dim a As Integer
Randomize
a = Int(Rnd * 3) + 1
If a = 1 Then
Image1.Picture = LoadPicture(App.Path & "\bao.jpg")
Label1.Caption = "包"
Label2.Caption = "包"
Image2.Picture = LoadPicture(App.Path & "\bao.jpg")
Label10.Caption = Label10.Caption + 1
MsgBox "看来我们的实力相当", vbInformation, "猜拳游戏"
Else
If a = 2 Then
Image1.Picture = LoadPicture(App.Path & "\jian.jpg")
Label1.Caption = "剪"
Label2.Caption = "包"
Image2.Picture = LoadPicture(App.Path & "\bao.jpg")
Label8.Caption = Label8.Caption + 1
MsgBox "你实在太垃圾了!哈哈~`", vbInformation, "猜拳游戏"
Else
Image1.Picture = LoadPicture(App.Path & "\chui.jpg")
Label1.Caption = "锤"
Label2.Caption = "包"
Image2.Picture = LoadPicture(App.Path & "\bao.jpg")
Label6.Caption = Label6.Caption + 1
MsgBox "这是我让你的!", vbInformation, "猜拳游戏"
End If
End If
End Sub
Private Sub Command2_Click()
Dim a As Integer
Randomize
a = Int(Rnd * 3) + 1
If a = 1 Then
Image1.Picture = LoadPicture(App.Path & "\bao.jpg")
Label1.Caption = "包"
Label2.Caption = "剪"
Image2.Picture = LoadPicture(App.Path & "\jian.jpg")
Label6.Caption = Label6.Caption + 1
MsgBox "这是我让你的!", vbInformation, "猜拳游戏"
Else
If a = 2 Then
Image1.Picture = LoadPicture(App.Path & "\jian.jpg")
Label1.Caption = "剪"
Label2.Caption = "剪"
Image2.Picture = LoadPicture(App.Path & "\jian.jpg")
Label10.Caption = Label10.Caption + 1
MsgBox "看来我们的实力相当", vbInformation, "猜拳游戏"
Else
Image1.Picture = LoadPicture(App.Path & "\chui.jpg")
Label1.Caption = "锤"
Label2.Caption = "剪"
Image2.Picture = LoadPicture(App.Path & "\jian.jpg")
Label8.Caption = Label8.Caption + 1
MsgBox "你实在太垃圾了!哈哈~`", vbInformation, "猜拳游戏"
End If
End If
End Sub
Private Sub Command3_Click()
Dim a As Integer
Randomize
a = Int(Rnd * 3) + 1
If a = 1 Then
Image1.Picture = LoadPicture(App.Path & "\bao.jpg")
Label1.Caption = "包"
Label2.Caption = "锤"
Image2.Picture = LoadPicture(App.Path & "\chui.jpg")
Label8.Caption = Label8.Caption + 1
MsgBox "你实在太垃圾了!哈哈~`", vbInformation, "猜拳游戏"
Else
If a = 2 Then
Image1.Picture = LoadPicture(App.Path & "\jian.jpg")
Label1.Caption = "剪"
Label2.Caption = "锤"
Image2.Picture = LoadPicture(App.Path & "\chui.jpg")
Label6.Caption = Label6.Caption + 1
MsgBox "这是我让你的!", vbInformation, "猜拳游戏"
Else
Image1.Picture = LoadPicture(App.Path & "\chui.jpg")
Label1.Caption = "锤"
Label2.Caption = "锤"
Image2.Picture = LoadPicture(App.Path & "\chui.jpg")
Label10.Caption = Label10.Caption + 1
MsgBox "看来我们的实力相当", vbInformation, "猜拳游戏"
End If
End If
End Sub
Private Sub Form_Load()
Label6.Caption = 0
Label6.ForeColor = vbGreen
Label8.Caption = 0
Label8.ForeColor = vbRed
Label10.Caption = 0
Label10.ForeColor = vbBlue
End Sub