📄 form1.frm
字号:
VERSION 5.00
Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"
Begin VB.Form Form1
Caption = "RichTextBox文本操作"
ClientHeight = 4080
ClientLeft = 60
ClientTop = 345
ClientWidth = 5670
LinkTopic = "Form1"
ScaleHeight = 4080
ScaleWidth = 5670
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "复制"
Height = 495
Left = 4080
TabIndex = 3
Top = 3240
Width = 975
End
Begin VB.CommandButton Command2
Caption = "剪切"
Height = 495
Left = 2400
TabIndex = 2
Top = 3240
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "拷贝"
Height = 495
Left = 840
TabIndex = 1
Top = 3240
Width = 1095
End
Begin RichTextLib.RichTextBox RichTextBox1
Height = 2655
Left = 600
TabIndex = 0
Top = 240
Width = 4455
_ExtentX = 7858
_ExtentY = 4683
_Version = 393217
ScrollBars = 3
TextRTF = $"Form1.frx":0000
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Const WM_PASTE = &H302
Const WM_CUT = &H300
Const WM_COPY = &H301
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Sub Command1_Click()
SendMessage RichTextBox1.hWnd, WM_COPY, 0, ByVal 0&
End Sub
Private Sub Command2_Click()
SendMessage RichTextBox1.hWnd, WM_CUT, 0, ByVal 0&
End Sub
Private Sub Command3_Click()
SendMessage RichTextBox1.hWnd, WM_PASTE, 0, ByVal 0&
End Sub
Private Sub Form_Load()
RichTextBox1.FileName = App.Path & "\zmhh.rtf"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -