有关timer和Rnd问题,急!
vb6.0吧
全部回复
仅看楼主
level 1
卫骊洁0gD 楼主
   在Form2窗体中,单击"预测"按钮,按0.1秒随机产生一个20以内的正整数
    该如何编写!! 求高手指点迷津! 不胜感激!!!
2010年10月21日 04点10分 1
level 1
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
Dim a As Integer
Command1.Caption = "预测"
Timer1.Interval = 100
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
Me.Caption = Time
a = Int(Rnd * 20) + 1
Label1.Caption = a
End Sub
2010年11月13日 04点11分 2
1