发布网友 发布时间:2024-12-28 08:06
共2个回答
热心网友 时间:2024-12-31 07:46
Private Sub Form_Load()
Timer1.Interval = 1000
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Static i As Integer
i = (i + 1) Mod 5
Picture1.Picture = LoadPicture(App.Path & "\" & (11 + i) & ".jpg")
End Sub
假定你的图片为:11.jpg-15.jpg,如果有更多,自己修改一下即可,比如:
Private Sub Timer1_Timer()
Static i As Integer
i = i + 1
If i > 15 Then i = 1
Picture1.Picture = LoadPicture(App.Path & "\" & i & ".jpg")
'Picture1.Picture = LoadPicture(App.Path & "\" & Right("0" & i, 2) & ".jpg")
End Sub
热心网友 时间:2024-12-31 07:46
你可以创建15个picture控件的数组,分别启动的时候加载图片,只显示一个控件,其他全隐藏,然后用timer计时器进行循环切换。
全局的变量
dim ct as integer
ct=0
Timer代码:
for i=0 to 14
picture(i).visible=false
next i
picture(ct).visible=true
ct=ct+1
if ct>14 then
ct=0
end if