Private Sub Command1_Click()
Randomize
Text1.Text = Int(Rnd * 201)
End Sub
你需要text1,command1各一个,然后复制代码就可以了。
Option Explicit
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Command2_Click()
Timer1.Enabled = False
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
Timer1.Interval = 100
End Sub
Private Sub Timer1_Timer()
Randomize
Label1.Caption = Int((200 - 1 + 1) * Rnd + 1)
End Sub