利用vb,我想text显示文字随着时间的变化而改变,用timer控件要怎样书写程序呢?具体情况见下面补充~大谢~
先formload许多单词word(0)=acceptword(1)=abandon……有10个然后dimiasintegerprivatesubtimer_time()...
先form load许多单词
word(0)=accept
word(1)=abandon……有10个
然后
dim i as integer
private sub timer_time()
for i = 1 to 10
text1.text=word(i)
next
end sub
为什么无法运行呢? 展开
word(0)=accept
word(1)=abandon……有10个
然后
dim i as integer
private sub timer_time()
for i = 1 to 10
text1.text=word(i)
next
end sub
为什么无法运行呢? 展开
2个回答
展开全部
在窗体上添加定时器控件(timer1),然后复制以下程序去测试:
Private Sub Form_Load()
Timer1.Enabled = False
For i = 0 To 9
word(i) = "xxx" & (i + 1)
Next
Timer1.Interval = 1000
i = 0
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Text1 = word(i)
If i = 9 Then
i = 0
Else
i = i + 1
End If
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
For i = 0 To 9
word(i) = "xxx" & (i + 1)
Next
Timer1.Interval = 1000
i = 0
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Text1 = word(i)
If i = 9 Then
i = 0
Else
i = i + 1
End If
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询