VB:做一个抽奖机(七个数的)。
发布网友
发布时间:2022-04-22 16:34
我来回答
共1个回答
热心网友
时间:2023-10-03 00:39
Private Sub Command1_Click()
Dim A As Integer, B As Integer
A = 5
Timer1.Enabled = False
B = Val(Text1.Text)
If A = B Then
MsgBox "哈哈!中奖了!再来!"
Timer1.Enabled = True
Else
MsgBox "哎!没有中奖呀!再来!"
Timer1.Enabled = True
End If
End Sub
Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 10
End Sub
Private Sub Timer1_Timer()
Randomize
Text1.Text = Int(Rnd * 9 + 1)
End Sub