vb实现2种滚动字幕
Dim step As Integer Private Sub Form_Load() Label1.Caption = "我是滚动字幕{一}。o(∩_∩)o " Timer1.Interval = 300 Label2.Caption = "我是滚动字幕{二}。o(∩_∩)o " Timer2.Interval = 10 Call Timer2_Timer step = 1 End Sub Private Sub Timer1_Timer() Label1.Caption = Mid(Label1.Caption, 2, Len(Label1.Caption) - 1) + Left(Label1.Caption, 1) End Sub Private Sub Timer2_Timer() If Label2.Left + Label2.Width > Me.Width Then step = -1 End If If Label2.Left < 0 Then step = 1 End If Label2.Left = Label2.Left + 15 * step End Sub Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Label1.ToolTipText = "我是滚动字幕{一}。o(∩_∩)o " End Sub Private Sub Label2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Label2.ToolTipText = Label2.Caption End Sub