📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
AutoRedraw = -1 'True
Caption = "图像框动画演示"
ClientHeight = 5295
ClientLeft = 60
ClientTop = 345
ClientWidth = 7170
LinkTopic = "Form1"
Picture = "Form1.frx":0000
ScaleHeight = 353
ScaleMode = 3 'Pixel
ScaleWidth = 478
StartUpPosition = 3 'Windows Default
Begin VB.Timer Timer1
Interval = 100
Left = 6120
Top = 2160
End
Begin VB.Image ImgPic
Appearance = 0 'Flat
Height = 1200
Index = 3
Left = 4200
Picture = "Form1.frx":165C0
Top = 3360
Visible = 0 'False
Width = 1200
End
Begin VB.Image ImgPic
Height = 1200
Index = 2
Left = 2760
Picture = "Form1.frx":16ED6
Top = 3480
Visible = 0 'False
Width = 1200
End
Begin VB.Image ImgPic
Height = 1200
Index = 1
Left = 1440
Picture = "Form1.frx":177C2
Top = 3600
Visible = 0 'False
Width = 1200
End
Begin VB.Image ImgPic
Height = 1200
Index = 0
Left = 120
Picture = "Form1.frx":18090
Top = 3600
Visible = 0 'False
Width = 1200
End
Begin VB.Image ImgWork
Height = 1200
Left = 3240
Picture = "Form1.frx":188CA
Top = 840
Width = 1200
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Image1_Click()
End Sub
Private Sub Timer1_Timer()
Static Forward, Down As Boolean, num As Integer
Dim NewLeft, NewTop As Long
If (((ImgWork.Left + ImgWork.Width) > Form1.ScaleWidth) And Forward) Or ((ImgWork.Left < 0) And Not Forward) Then
Forward = Not Forward
End If
If Forward Then
NewLeft = ImgWork.Left + 10
Else
NewLeft = ImgWork.Left - 10
End If
If (((ImgWork.Top + ImgWork.Height) > Form1.ScaleHeight) And Down) Or ((ImgWork.Top < 0) And Not Down) Then
Down = Not Down
End If
If Down Then
NewTop = ImgWork.Top + 7
Else
NewTop = ImgWork.Top - 7
End If
'------
ImgWork.Move NewLeft, NewTop
If num > 3 Then num = 0
ImgWork.Picture = ImgPic(num).Picture
num = num + 1
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -