📄 6-3p.frm
字号:
VERSION 5.00
Begin VB.Form Form2
Caption = "Form2"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form2"
MDIChild = -1 'True
ScaleHeight = 3195
ScaleWidth = 4680
Begin VB.VScrollBar VScroll1
Height = 2055
Left = 3960
TabIndex = 3
Top = 360
Width = 255
End
Begin VB.HScrollBar HScroll1
Height = 255
Left = 600
TabIndex = 2
Top = 2640
Width = 3015
End
Begin VB.PictureBox Picture1
Height = 2055
Left = 240
ScaleHeight = 1995
ScaleWidth = 2715
TabIndex = 0
Top = 120
Width = 2775
Begin VB.PictureBox Picture2
AutoRedraw = -1 'True
AutoSize = -1 'True
BorderStyle = 0 'None
Height = 1695
Left = 240
ScaleHeight = 1695
ScaleWidth = 2175
TabIndex = 1
Top = 120
Width = 2175
End
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public Sub Init_Scroll()
Dim i As Integer
i = Picture2.Height - Picture1.Height
'If i < 0 Then i = 0
VScroll1.Max = i
i = Picture2.Width - Picture1.Width
'If i < 0 Then i = 0
HScroll1.Max = i
End Sub
Private Sub Form_Load()
'装载窗体时触发该事件
Picture1.Top = 0
Picture1.Left = 0
Picture2.Top = 0
Picture2.Left = 0
VScroll1.Top = 0
HScroll1.Left = 0
End Sub
Private Sub Form_Resize()
'改变窗体大小时触发该事件
'为获得窗体Form1的大小,要使用ScaleWidth和ScaleHeight属性
'不要使用其Width和Height属性。
'ScaleWidth属性代表窗体Form1可用宽度,
'而Width属性代表其外边界宽度,既在Screen对象中的宽度。
If Me.ScaleWidth > VScroll1.Width Then
Picture1.Width = Me.ScaleWidth - VScroll1.Width
End If
If Me.ScaleHeight > VScroll1.Height Then
Picture1.Height = Me.ScaleHeight - HScroll1.Height
End If
VScroll1.Left = Picture1.Width
VScroll1.Height = Picture1.Height
VScroll1.SmallChange = Picture1.Height / 10
VScroll1.LargeChange = Picture1.Height
HScroll1.Top = Picture1.Height
HScroll1.Width = Picture1.Width
HScroll1.SmallChange = Picture1.Width / 10
HScroll1.LargeChange = Picture1.Width
Init_Scroll
End Sub
Private Sub HScroll1_Change()
Picture2.Left = -HScroll1.Value
End Sub
Private Sub HScroll1_Scroll()
Picture2.Left = -HScroll1.Value
End Sub
Private Sub VScroll1_Change()
Picture2.Top = -VScroll1.Value
End Sub
Private Sub VScroll1_Scroll()
Picture2.Top = -VScroll1.Value
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -