用VB制作显示图片循环~看代码,如何设置循环?
Dima(30)AsStringDimiAsIntegerDimjAsIntegerPrivateSubForm_Load()Fori=0To30a(i)="pic\"&...
Dim a(30) As String
Dim i As Integer
Dim j As Integer
Private Sub Form_Load()
For i = 0 To 30
a(i) = "pic\" & i + 1 & ".jpg"
Next
End Sub
Private Sub m3_Click() 'm3我代表的是3秒显示图片
Timer1.Enabled = True
Timer1.Interval = 3000
End Sub
Private Sub timer1_timer()
Picture1.Picture = LoadPicture(a(j))
If j < 30 Then
j = j + 1
Else
Timer1.Enabled = False
End If
End Sub
如何设置他图片播放完30张然后循环显示? 展开
Dim i As Integer
Dim j As Integer
Private Sub Form_Load()
For i = 0 To 30
a(i) = "pic\" & i + 1 & ".jpg"
Next
End Sub
Private Sub m3_Click() 'm3我代表的是3秒显示图片
Timer1.Enabled = True
Timer1.Interval = 3000
End Sub
Private Sub timer1_timer()
Picture1.Picture = LoadPicture(a(j))
If j < 30 Then
j = j + 1
Else
Timer1.Enabled = False
End If
End Sub
如何设置他图片播放完30张然后循环显示? 展开
2个回答
2013-08-12
展开全部
当j>30时将j重置为1
Private Sub timer1_timer()
Picture1.Picture = LoadPicture(a(j))
j = j + 1
If j > 30 Then '
j=1 '当j>30时将j重置为1
end if
End Sub
Private Sub timer1_timer()
Picture1.Picture = LoadPicture(a(j))
j = j + 1
If j > 30 Then '
j=1 '当j>30时将j重置为1
end if
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-08-12
展开全部
'其他的不用修改
Private Sub timer1_timer()
Picture1.Picture = LoadPicture(a(j))
j = j + 1
If j > 29 Then j = j - 30
End Sub
Private Sub timer1_timer()
Picture1.Picture = LoadPicture(a(j))
j = j + 1
If j > 29 Then j = j - 30
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询