添加3个timer控键,第一个timer控键设置interval属性为1000(1秒),双击该控键在 Private Sub Timer1_Timer() '你随机生成数的方法,值付给text1 End Sub 第二个timer控键设置interval属性为2000(2秒),双击该控键在 Private Sub Timer2_Timer() '你随机生成数的方法 End Sub 第三个timer控键设置interval属性为3000(3秒),双击该控键在 Private Sub Timer3_Timer() '你随机生成数的方法 End Sub
Private Sub Timer1_Timer()
'你随机生成数的方法,值付给text1
End Sub
第二个timer控键设置interval属性为2000(2秒),双击该控键在
Private Sub Timer2_Timer()
'你随机生成数的方法
End Sub
第三个timer控键设置interval属性为3000(3秒),双击该控键在
Private Sub Timer3_Timer()
'你随机生成数的方法
End Sub
第一次點擊,調用TIMER1,在文本框中顯示第一個隨機數
...
...
Me.Command1.Tag = Val(Me.Command1.Tag) + 1
If Val(Me.Command1.Tag) = 4 Then Me.Timer1.Enabled = False
End SubPrivate Sub Command2_Click()
Me.Timer1.Enabled = True
Me.Command1.Tag = 1
End SubPrivate Sub Form_Load()
Me.Timer1.Interval = 60
Me.Timer1.Enabled = False
Me.Command1.Tag = 0
End SubPrivate Sub Timer1_Timer()
Select Case Val(Me.Command1.Tag)
Case 1
Text1.Text = Int(Rnd * 10)
Text2.Text = Int(Rnd * 10)
Text3.Text = Int(Rnd * 10)
DoEvents
Case 2
Text2.Text = Int(Rnd * 10)
Text3.Text = Int(Rnd * 10)
DoEvents
Case 3
Text3.Text = Int(Rnd * 10)
DoEvents
End Select
End Sub