上下滚动的字符动画制作方法
一、窗体
在窗体中插入选定的图片,1个标签。图片上下有两个矩形的方框,是用来遮蔽动画运行中多余的部分的,其它都在代码中解决了。
二、窗体代码
Option Compare Database
Dim I As Integer
Dim x As Integer
Dim y As Integer
Private Sub Form_Load()
x = Label0.Left
y = Label0.Top
End Sub
Private Sub Form_Timer()
If I < 10 Then
Label0.Move Label0.Left, Label0.Top - 100
End If
If I > 30 And I < 40 Then
Label0.Move Label0.Left, Label0.Top - 100
End If
If I = 40 Then
Label0.Move x, y
If Label0.Caption = "Access软件网" Then
Label0.Caption = "学习交流的好地方"
I = 0
Exit Sub
End If
If Label0.Caption = "学习交流的好地方" Then
Label0.Caption = "ACCESS学习简单快乐"
I = 0
Exit Sub
End If
If Label0.Caption = "ACCESS学习简单快乐" Then
Label0.Caption = "服务广大爱好者"
I = 0
Exit Sub
End If
If Label0.Caption = "服务广大爱好者" Then
Label0.Caption = "Access软件网"
I = 0
Exit Sub
End If
End If
I = I + 1
End Sub
附件:
点击下载此附件