📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "图片移动"
ClientHeight = 3435
ClientLeft = 60
ClientTop = 345
ClientWidth = 5040
LinkTopic = "Form1"
ScaleHeight = 3435
ScaleWidth = 5040
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Command5
Caption = "退出"
Height = 405
Left = 45
TabIndex = 5
Top = 2985
Width = 4920
End
Begin VB.CommandButton Command4
Caption = "复位"
Height = 405
Left = 3780
TabIndex = 4
Top = 2490
Width = 1200
End
Begin VB.CommandButton Command3
Caption = "沿对角线移动"
Height = 405
Left = 2535
TabIndex = 3
Top = 2490
Width = 1200
End
Begin VB.CommandButton Command2
Caption = "垂直移动"
Height = 405
Left = 1290
TabIndex = 2
Top = 2490
Width = 1200
End
Begin VB.CommandButton Command1
Caption = "水平移动"
Height = 405
Left = 45
TabIndex = 1
Top = 2490
Width = 1200
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 1230
Left = 135
ScaleHeight = 1200
ScaleWidth = 1680
TabIndex = 0
Top = 540
Width = 1710
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()
Picture1.Picture = LoadPicture(App.Path & "\image.jpg")
End Sub
Private Sub Command1_Click()
'沿水平方向在窗体中移动
Picture1.Move Picture1.Left + 200
End Sub
Private Sub Command2_Click()
'沿垂直方向在窗体中移动
Picture1.Move Picture1.Left, Picture1.Top - 300
End Sub
Private Sub Command3_Click()
'沿对角线方向在窗体中移动
Picture1.Move Picture1.Left + 750, Picture1.Top - 550
End Sub
Private Sub Command4_Click()
'复位
Picture1.Left = 135
Picture1.Top = 540
End Sub
Private Sub Command5_Click()
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -