高手指教!
Private Sub Timer1_Timer()Dim n As Integer
Dim a1 As Integer
Dim a2 As Integer
Dim a3 As Integer
Dim a4 As Integer
Dim a5 As Integer
Dim b As Integer
Dim speed As Integer
Do While n <= 10
Randomize
b = Int(10 * Rnd()) + 1
speed = 2 * (Int(5 * Rnd()) + 1)
If b = 1 Then
Picture1.Left = Picture1.Left + speed
ElseIf b = 3 Then
Picture2.Left = Picture2.Left + speed
ElseIf b = 5 Then
Picture3.Left = Picture3.Left + speed
ElseIf b = 7 Then
Picture4.Left = Picture5.Left + speed
ElseIf b = 9 Then
Picture5.Left = Picture5.Left + speed
End If
n = n + 1
Loop
End Sub
当n大于10时循环就回停止,为什么这个程序能一直运行下去?请高手多多指教。