VB关於List的问题

来源:百度知道 编辑:UC知道 时间:2024/05/17 05:05:17
比如ListBox裏面有x项内容.还有个计时器.然后就每隔3秒就在窗体上Print.首先是ListBox的第一项.隔3秒后又Print第二项……到最后一项时又回到第一项.

Private Sub Timer1_Timer()
Static i As Integer
Print List1.List(i)
i = i + 1
If i = List1.ListCount Then i = 0
End Sub

timer1的interval属性设置成3000

在timer事件过程中加入如下代码:
static i as integer
print list1.list(i)
i=i+1
并且timer1的interval属性设置成3000