7,763
社区成员
发帖
与我相关
我的任务
分享
Option Explicit
Dim strTest() As String
Private Sub Command1_Click()
ReDim strTest(10)
Dim i As Integer
For i = 1 To 10
strTest(i) = "这是第" & i & "个字符串"
Next
Timer1.Interval = 20
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Static deg As Double
Static strPoint As Long
Dim intLight As Integer
intLight = Fix(255 * (Cos(deg / 180 * 3.1415926) + 1) / 2)
Text1.ForeColor = RGB(intLight, intLight, intLight)
DoEvents
If deg Mod 360 = 0 Then
strPoint = strPoint + 1
If strPoint > UBound(strTest) Then
Timer1.Enabled = False
Text1.Text = "完毕"
Text1.ForeColor = vbBlack
Exit Sub
Else
Text1.Text = strTest(strPoint)
End If
End If
deg = deg + 3
End Sub