📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form form1
AutoRedraw = -1 'True
BackColor = &H00E0E0E0&
Caption = "位图动画"
ClientHeight = 3630
ClientLeft = 165
ClientTop = 450
ClientWidth = 4335
LinkTopic = "Form1"
ScaleHeight = 3627.379
ScaleMode = 0 'User
ScaleWidth = 4335
StartUpPosition = 1 '所有者中心
Begin VB.TextBox Text1
Height = 630
Left = 150
TabIndex = 2
Text = "0"
Top = 1440
Visible = 0 'False
Width = 480
End
Begin VB.Timer Timer1
Interval = 500
Left = 1710
Top = 900
End
Begin VB.CommandButton Command1
Caption = "退出"
Height = 375
Left = 3240
TabIndex = 1
Top = 3225
Width = 1050
End
Begin VB.PictureBox imgSrc
Appearance = 0 'Flat
AutoRedraw = -1 'True
AutoSize = -1 'True
BackColor = &H80000005&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 945
Left = 90
Picture = "form1.frx":0000
ScaleHeight = 945
ScaleWidth = 915
TabIndex = 0
Top = 150
Visible = 0 'False
Width = 915
End
End
Attribute VB_Name = "form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i As Long
Dim a As Long
Dim b As Long
Private Sub Form_Load()
a = 0
b = 0
i = 0
End Sub
Private Sub Timer1_Timer()
Text1.Text = Val(Text1.Text) + 5
i = Text1.Text
If i / 2 = Int(i / 2) Then imgSrc.Picture = LoadPicture(App.Path & "\02.bmp") Else imgSrc.Picture = LoadPicture(App.Path & "\01.bmp")
If i < 50 Then '位图动画水平向右移
a = a + 300
Me.Cls
Me.PaintPicture imgSrc, a, b, imgSrc.ScaleWidth, imgSrc.ScaleHeight, _
0, 0, imgSrc.Width, imgSrc.Height, vbSrcAnd
End If
If i > 50 And i < 100 Then '位图动画垂直向下移
b = b + 300
Me.Cls
Me.PaintPicture imgSrc, a, b, imgSrc.ScaleWidth, imgSrc.ScaleHeight, _
0, 0, imgSrc.Width, imgSrc.Height, vbSrcAnd
End If
If i > 100 And i < 150 Then '位图动画水平向左移
a = a - 300
Me.Cls
Me.PaintPicture imgSrc, a, b, imgSrc.ScaleWidth, imgSrc.ScaleHeight, _
0, 0, imgSrc.Width, imgSrc.Height, vbSrcAnd
End If
If i > 150 And i < 200 Then '位图动画垂直向上移
b = b - 300
Me.Cls
Me.PaintPicture imgSrc, a, b, imgSrc.ScaleWidth, imgSrc.ScaleHeight, _
0, 0, imgSrc.Width, imgSrc.Height, vbSrcAnd
End If
If Text1.Text > 200 Then Text1.Text = 0
End Sub
Private Sub Command1_Click()
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -