[vb]代码库
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
[代码运行效果截图]
[源代码打包下载]
初级程序员
by: 云代码会员 发表于:2014-08-18 22:53:54 顶(1) | 踩(1) 回复
不错
回复评论