Private Sub cmdBig_Click()
lblChoice.Caption = "大"
cmdStart.Enabled = True
cmdNo1.Caption = ""
cmdNo2.Caption = ""
cmdNo3.Caption = ""
lblResult.Caption = ""
lblwin.Caption = ""
End Sub
Private Sub cmdSmall_Click()
lblChoice.Caption = "小"
cmdStart.Enabled = True
cmdNo1.Caption = ""
cmdNo2.Caption = ""
cmdNo3.Caption = ""
lblResult.Caption = ""
lblwin.Caption = ""
End Sub
Private Sub cmdStart_Click()
Timer1.Enabled = True
cmdStart.Enabled = False
cmdStop.Enabled = True
cmdBig.Enabled = False
cmdSmall.Enabled = False
End Sub
Private Sub cmdStop_Click()
Timer1.Enabled = False
Dim sum As Integer
sum = Val(cmdNo1.Caption) + Val(cmdNo2.Caption) + Val(cmdNo3.Caption)
If sum > 10 Then
lblResult.Caption = "大"
Else
lblResult.Caption = "小"
End If
If lblChoice = lblResult Then
lblwin.Caption = "您赢了"
Else
lblwin.Caption = "您输了"
End If
cmdStop.Enabled = False
cmdStart.Enabled = True
cmdBig.Enabled = True
cmdSmall.Enabled = True
cmdNo1.Enabled = True
cmdNo2.Enabled = True
cmdNo3.Enabled = True
End Sub
Private Sub Timer1_Timer()
Randomize
cmdNo1.Caption = Int(Rnd() * 6) + 1
cmdNo2.Caption = Int(Rnd() * 6) + 1
cmdNo3.Caption = Int(Rnd() * 6) + 1
End Sub