一个关于VB显示随机数字的问题
来源:百度知道 编辑:UC知道 时间:2024/05/23 02:08:02
非常着急,我做了一个时间控件,要显示指定的数字
代码是这样的:
Private Sub Command1_Click()
Call Timer1_Timer
End Sub
Private Sub Timer1_Timer()
Dim num As Integer
aaa:
num = 1
For num = 1 To 14
num = num + 1
Label1.Caption = num
Next
If num > 15 Then
GoTo aaa
End If
End Sub
除了问题,请高手帮忙!!!
代码是这样的:
Private Sub Command1_Click()
Call Timer1_Timer
End Sub
Private Sub Timer1_Timer()
Dim num As Integer
aaa:
num = 1
For num = 1 To 14
num = num + 1
Label1.Caption = num
Next
If num > 15 Then
GoTo aaa
End If
End Sub
除了问题,请高手帮忙!!!
以上代码只运行一次
以下是更改以后的代码
Dim num As Integer
Private Sub Command1_Click()
Timer1.enabled=true
End Sub
Private Sub Timer1_Timer()
num = num + 1
Label1.Caption = num
If num > 15 Then
num=1
End If
End Sub