窗体上有1个名称为List1 含有3个项目的列表框 1个名称为Text1的文本框 以及1个Interval属性值为1
已帮助 人
窗体上有1个名称为List1、含有3个项目的列表框,1个名称为Text1的文本框,以及1个Interval属性值为1000的计时器控件Timer1。某人编制了以下程序,希望程序运行时,每隔1秒, List1中的3个项目能够依次在Text1中循环显示。 Private Sub Timer1_Timer() Dim i As Integer Text1.Text = List1.List(i) i = i + 1 If i = List1.ListCount Then i = 0 End If End Sub 运行程序,发现有错误。以下正确的修改是________。
A.将If语句的条件修改为 i <= List1.ListCount
B.将Interval属性值改为100
C.将语句Dim i As Integer修改为Static i As Integer
D.将语句Text1.Text = List1.List(i)与i = i + 1交换位置

回答
共1条回复-
将语句 Dim i As Integer 修改为 Static i As Integer
