用vb的timer在文本框中制作滚动字幕

来源:百度知道 编辑:UC知道 时间:2024/05/17 02:12:17
谢谢了 急用!!!!

Dim i As Integer

Const sTemp = "I Love This Game !~"

Private Sub Form_Load()
Label1.Caption = sTemp
Label1.BackColor = vbBlack
Label1.ForeColor = vbWhite
Label1.Font.Size = 18
Timer1.Interval = 1000
i = 1
End Sub

Private Sub Timer1_Timer()
If Label1.Caption = "" Then
i = 1
Label1.Caption = sTemp
End If
Label1.Caption = Mid(sTemp, i, Len(sTemp))
i = i + 1
End Sub