📄 marquee.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 5205
ClientLeft = 60
ClientTop = 345
ClientWidth = 5475
LinkTopic = "Form2"
ScaleHeight = 5205
ScaleWidth = 5475
StartUpPosition = 3 'Windows Default
Begin VB.PictureBox Picture1
AutoSize = -1 'True
BorderStyle = 0 'None
Height = 6045
Left = 0
Picture = "MARQUEE.frx":0000
ScaleHeight = 6045
ScaleWidth = 5475
TabIndex = 0
Top = -840
Width = 5475
Begin VB.Timer Timer1
Interval = 100
Left = 480
Top = 4560
End
Begin VB.Label Label1
Alignment = 2 'Center
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Label1"
ForeColor = &H00FF0000&
Height = 195
Left = 2880
TabIndex = 1
Top = 2160
Width = 480
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
'在代码中设置Label1的一些属性
With Label1
.Font = "宋体"
.FontBold = True
.FontSize = 15
'设置显示的内容,vbCrLf表示回车换行
.Caption = "主要演员" + vbCrLf + vbCrLf + _
"郭 靖-------------黄日华" + vbCrLf + _
"黄 蓉-------------翁美玲" + vbCrLf + _
"黄药师-------------东 邪" + vbCrLf + _
"欧阳峰-------------西 毒" + vbCrLf + _
"段智兴-------------南 帝" + vbCrLf + _
"洪七公-------------北 丐" + vbCrLf
.Top = Form1.ScaleHeight '开始在窗体底部
.Left = (Form1.ScaleWidth - .Width) / 2 '居中
End With
End Sub
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Timer1.Enabled = False '鼠标以上去时,字幕停止卷动
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Timer1.Enabled = True '鼠标移开Label1后,字幕继续卷动
End Sub
Private Sub Timer1_Timer()
eachstep = 20 '每次上移的距离,可自行设定
Label1.Top = Label1.Top - eachstep
If Label1.Top < -Label1.Height Then '滚动到窗体外后,在回到最下面
Label1.Top = Form1.ScaleHeight
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -