📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "自制滚动文本框"
ClientHeight = 2835
ClientLeft = 60
ClientTop = 345
ClientWidth = 3930
LinkTopic = "Form1"
ScaleHeight = 2835
ScaleWidth = 3930
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command4
Caption = "左卷一列"
Height = 375
Left = 2400
TabIndex = 4
Top = 2040
Width = 1095
End
Begin VB.CommandButton Command3
Caption = "右卷一列"
Height = 375
Left = 2400
TabIndex = 3
Top = 1440
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "上卷一行"
Height = 375
Left = 2400
TabIndex = 2
Top = 840
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "下卷一行"
Height = 375
Left = 2400
TabIndex = 1
Top = 240
Width = 1095
End
Begin VB.TextBox Text1
Height = 1215
Left = 240
MultiLine = -1 'True
ScrollBars = 3 'Both
TabIndex = 0
Text = "Form1.frx":0000
Top = 240
Width = 1935
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Const EM_LINESCROLL = &HB6
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Sub Command1_Click()
ret = SendMessage(Text1.hwnd, EM_LINESCROLL, 0, 1) ' 下卷一行
End Sub
Private Sub Command2_Click()
ret = SendMessage(Text1.hwnd, EM_LINESCROLL, 0, -1) ' 上卷一行
End Sub
Private Sub Command3_Click()
ret = SendMessage(Text1.hwnd, EM_LINESCROLL, 1, 0) ' 右卷一列
End Sub
Private Sub Command4_Click()
ret = SendMessage(Text1.hwnd, EM_LINESCROLL, -1, 0) ' 左卷一列
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -