求助VB字幕动画移动程序

来源:百度知道 编辑:UC知道 时间:2024/06/12 20:36:19
设计一个字幕动画程序当点击“向左移动”按钮后,字幕循环向左匀速移动;当点击“向右移动”按钮后,字幕循环向右匀速移动。当点击“停止移动”按钮后,字幕停止移动。

望高手能帮帮小弟

Dim i As Integer '1:左0:停2:右
Private Sub Com_list_Click()
i = 1
End Sub

Private Sub Com_right_Click()
i = 2
End Sub

Private Sub Com_stop_Click()
i = 0
End Sub

Private Sub Timer1_Timer()
If i = 1 Then
Label1.Left = Label1.Left - 10
End If
If i = 2 Then
Label1.Left = Label1.Left + 10
End If

End Sub

用到了timer控件,调整timer控件的时间可以使字幕移动的速度变化,时间越小速度越快