|
在登录窗口中,用计时器,循环 显示img(9)数组变量
我搞了很久没搞明白,me.imgline0~me.imgline9代表窗体的什么样子的东西?
代码如下:
Private Sub Form_Load()
On Error GoTo err
Set img(0) = Me.imgLine1
Set img(1) = Me.imgLine2
Set img(2) = Me.imgLine3
Set img(3) = Me.imgLine4
Set img(4) = Me.imgLine5
Set img(5) = Me.imgLine6
Set img(6) = Me.imgLine7
Set img(7) = Me.imgLine8
Set img(8) = Me.imgLine9
Set img(9) = Me.imgLine10
Me.TimerInterval = 150
Exit Sub
err:
MsgBox err.Number & err.Description
End Sub
---------------------------------------------
Private Sub Form_Timer()
If I > 9 Then I = 0
Call showLineImg(I)
I = I + 1
End Sub
----------------------------------------------
Private Function showLineImg(ByVal CurrentImgNo As Integer)
Dim c As Integer
For c = 0 To 9
If CurrentImgNo = c Then
img(c).Visible = True
Else
img(c).Visible = False
End If
Next c
End Function
|
|