我是初学着,而且是自学的,现在有个问题请教下啊,里面的i值是什么啊?
Public Class Form1Dim i0, i1, i2, i3, x As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Load
x = 400
i1 = Val(TextBox1.Text)
i2 = Val(TextBox2.Text)
i3 = Val(TextBox3.Text)
i0 = i1 + i2 + i3 + i2
Timer1.Interval = 100
End Sub
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Static i As Integer, dx%
Dim k%
i = i + 1
If i <= i1 * 10 Then
PictureBox4.Image = PictureBox1.Image
k = 1
ElseIf i <= (i1 + i2) * 10 Then
PictureBox4.Image = PictureBox2.Image
k = 2
ElseIf i <= (i1 + i2 + i3) * 10 Then
PictureBox4.Image = PictureBox3.Image
k = 3
ElseIf i <= i0 * 10 Then
PictureBox4.Image = PictureBox2.Image
k = 2
If i = i0 * 10 Then i = 0
End If
If k = 3 Then
If dx < 4 Then dx = dx + 1
Else
If x > 130 Or x < 100 Then
dx = 4
ElseIf x > 120 Then
dx = 3
ElseIf x > 110 Then
dx = 2
ElseIf x > 100 Then
dx = 1
Else
dx = 0
End If
End If
x = x - dx
If x <= -100 Then x = 400
PictureBox5.Left = x
End Sub
End Class