📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "滚动条"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text2
Height = 375
Left = 1920
TabIndex = 4
Text = "0"
Top = 1320
Width = 1335
End
Begin VB.TextBox Text1
Height = 375
Left = 1920
TabIndex = 3
Text = "0"
Top = 600
Width = 1335
End
Begin VB.PictureBox Picture1
Height = 135
Left = 2520
ScaleHeight = 135
ScaleWidth = 15
TabIndex = 2
Top = 1800
Width = 15
End
Begin VB.HScrollBar HScroll1
Height = 255
Left = 840
Max = 300
TabIndex = 1
Top = 2640
Width = 2775
End
Begin VB.VScrollBar VScroll1
Height = 2055
Left = 840
Max = 400
TabIndex = 0
Top = 480
Value = 400
Width = 255
End
Begin VB.Label Label2
Caption = "Y:"
Height = 180
Left = 1440
TabIndex = 6
Top = 1320
Width = 270
End
Begin VB.Label Label1
Caption = "X:"
Height = 255
Left = 1440
TabIndex = 5
Top = 600
Width = 375
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub HScroll1_Change()
Text1.Text = HScroll1.Value
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
k = CInt(Text1.Text)
If k <= 300 Then
HScroll1.Value = k
End If
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
k = CInt(Text2.Text)
If k <= 400 Then
VScroll1.Value = 400 - k
End If
End If
End Sub
Private Sub VScroll1_Change()
Dim k As Integer
k = VScroll1.Value
k = Abs(k - 400)
Text2.Text = CStr(k)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -