📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form form1
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 0 'None
Caption = "Form1"
ClientHeight = 5415
ClientLeft = 1995
ClientTop = 1995
ClientWidth = 6660
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5415
ScaleWidth = 6660
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Command1
Caption = "退出"
Height = 345
Left = -30
TabIndex = 3
Top = 4770
Width = 1605
End
Begin VB.TextBox Text2
Height = 315
Left = 885
TabIndex = 2
Top = 0
Visible = 0 'False
Width = 810
End
Begin VB.TextBox Text1
Height = 315
Left = 0
TabIndex = 1
Top = 0
Visible = 0 'False
Width = 870
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 9030
Left = -1650
MousePointer = 1 'Arrow
Picture = "form1.frx":0000
ScaleHeight = 9000
ScaleWidth = 12000
TabIndex = 0
Top = -3615
Width = 12030
Begin VB.Timer Timer1
Interval = 50
Left = 540
Top = 885
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "鼠标分别向上向下向左向右移动,观看效果!"
Height = 540
Left = 3240
TabIndex = 4
Top = 6330
Width = 4200
End
End
End
Attribute VB_Name = "form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Sub Timer1_Timer()
Dim n As POINTAPI
GetCursorPos n
If n.X - Me.Left / 15 - 3 < 0 And Picture1.Left < 0 Then '地图向右移
Picture1.Left = Picture1.Left + 100
End If
If n.Y - Me.Top / 15 - 3 < 0 And Picture1.Top < 0 Then '地图向下移
Picture1.Top = Picture1.Top + 100
End If
If n.X - Me.Left / 15 - Me.Width / 15 > -10 And Picture1.Left > -5400 Then '地图向左移
Picture1.Left = Picture1.Left - 100
End If
If n.Y - Me.Top / 15 - Me.Height / 15 > -10 And Picture1.Top > -3615 Then '地图向上移
Picture1.Top = Picture1.Top - 100
End If
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) '鼠标按下
Dim n As POINTAPI
GetCursorPos n
Text1.Text = n.X
Text2.Text = n.Y
End Sub
Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) '鼠标拖拽地图
Dim n As POINTAPI
GetCursorPos n
Picture1.Left = Picture1.Left - Val(Text1.Text) * 15 + n.X * 15
Picture1.Top = Picture1.Top - Val(Text2.Text) * 15 + n.Y * 15
End Sub
Private Sub Command1_Click()
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -