用api滚动listbox二.frm
来自「个人VB学习源码精选,自己学习时的一些编程小程序,希望对大家有帮助」· FRM 代码 · 共 86 行
FRM
86 行
VERSION 5.00
Begin VB.Form Form1
Caption = "利用程序控制TextBox的滚动"
ClientHeight = 3120
ClientLeft = 60
ClientTop = 345
ClientWidth = 5280
LinkTopic = "Form1"
ScaleHeight = 3120
ScaleWidth = 5280
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Command4
Caption = "Bottom"
Height = 375
Left = 4320
TabIndex = 4
Top = 1200
Width = 735
End
Begin VB.CommandButton Command3
Caption = "Down"
Height = 375
Left = 4320
TabIndex = 3
Top = 840
Width = 735
End
Begin VB.CommandButton Command2
Caption = "Up"
Height = 375
Left = 4320
TabIndex = 2
Top = 480
Width = 735
End
Begin VB.CommandButton Command1
Caption = "Top"
Height = 375
Left = 4320
TabIndex = 1
Top = 120
Width = 735
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "PMingLiU"
Size = 12
Charset = 136
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 2775
Left = 240
MultiLine = -1 'True
ScrollBars = 3 'Both
TabIndex = 0
Text = "用API滚动ListBox二.frx":0000
Top = 120
Width = 3975
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
SendMessage Text1.hwnd, EM_SCROLL, SB_PAGEUP, ByVal 0&
End Sub
Private Sub Command2_Click()
SendMessage Text1.hwnd, EM_SCROLL, SB_LINEUP, ByVal 0&
End Sub
Private Sub Command3_Click()
SendMessage Text1.hwnd, EM_SCROLL, SB_LINEDOWN, ByVal 0&
End Sub
Private Sub Command4_Click()
SendMessage Text1.hwnd, EM_SCROLL, SB_PAGEDOWN, ByVal 0&
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?