📄 form1.frm
字号:
VERSION 5.00
Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "richtx32.ocx"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 2760
ClientLeft = 165
ClientTop = 855
ClientWidth = 4575
LinkTopic = "Form1"
ScaleHeight = 2760
ScaleWidth = 4575
StartUpPosition = 3 'Windows Default
Begin MSComDlg.CommonDialog CommonDialog1
Left = 360
Top = 2280
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin RichTextLib.RichTextBox RichTextBox1
Height = 3015
Left = 0
TabIndex = 0
Top = 0
Visible = 0 'False
Width = 4575
_ExtentX = 8070
_ExtentY = 5318
_Version = 393217
Enabled = -1 'True
TextRTF = $"Form1.frx":0000
End
Begin VB.Menu file
Caption = "File"
Begin VB.Menu Open
Caption = "Open"
End
Begin VB.Menu Save
Caption = "Save"
End
Begin VB.Menu New
Caption = "New"
End
Begin VB.Menu Exit
Caption = "Exit"
End
End
Begin VB.Menu Edit
Caption = "Edit"
Begin VB.Menu Cut
Caption = "Cut"
End
Begin VB.Menu Copy
Caption = "Copy"
End
Begin VB.Menu Paste
Caption = "Paste"
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Copy_Click()
Clipboard.SetText (RichTextBox1.SelText)
End Sub
Private Sub Cut_Click()
Clipboard.SetText (RichTextBox1.SelText)
RichTextBox1.SelText = ""
End Sub
Private Sub Exit_Click()
If (RichTextBox1.Text <> "") Then
If MsgBox("Do You Want To Save Changes ?", vbYesNoCancel) = vbYes Then
CommonDialog1.ShowSave
RichTextBox1.SaveFile (CommonDialog1.FileName)
Unload Me
ElseIf (MsgBox("Do You Want To Save Changes ?", vbYesNoCancel)) = vbCancel Then
Else
Unload Me
End If
End If
End Sub
Private Sub New_Click()
RichTextBox1.Visible = True
End Sub
Private Sub Open_Click()
CommonDialog1.ShowOpen
RichTextBox1.LoadFile (CommonDialog1.FileName)
RichTextBox1.Visible = True
End Sub
Private Sub Paste_Click()
RichTextBox1.Text = RichTextBox1.Text + Clipboard.GetText
End Sub
Private Sub Save_Click()
If (RichTextBox1.Text <> "") Then
CommonDialog1.ShowSave
RichTextBox1.SaveFile (CommonDialog1.FileName)
Else
MsgBox ("No Text To Save !!!")
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -