form1.frm
来自「上传的包含两个文件」· FRM 代码 · 共 154 行
FRM
154 行
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 4035
ClientLeft = 165
ClientTop = 735
ClientWidth = 6180
LinkTopic = "Form1"
ScaleHeight = 4035
ScaleWidth = 6180
StartUpPosition = 3 '窗口缺省
Begin MSComDlg.CommonDialog CommonDialog1
Left = 240
Top = 1920
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.Menu file
Caption = "文件"
Begin VB.Menu save
Caption = "保存"
Shortcut = ^S
End
Begin VB.Menu new
Caption = "新建"
Shortcut = ^N
End
Begin VB.Menu open
Caption = "打开"
Shortcut = ^O
End
Begin VB.Menu c
Caption = "-"
End
Begin VB.Menu exit
Caption = "退出(&X)"
End
End
Begin VB.Menu font1
Caption = "字体"
Begin VB.Menu ita
Caption = "倾斜字体"
Shortcut = ^I
End
Begin VB.Menu under
Caption = "下划线"
Shortcut = ^U
End
Begin VB.Menu bo
Caption = "加粗"
Shortcut = ^B
End
End
Begin VB.Menu a
Caption = "字号"
Begin VB.Menu a1
Caption = "6"
End
Begin VB.Menu a2
Caption = "8"
End
Begin VB.Menu a3
Caption = "10"
End
Begin VB.Menu a4
Caption = "12"
End
Begin VB.Menu a5
Caption = "16"
End
End
Begin VB.Menu col
Caption = "颜色"
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub a1_Click()
Form2.Show
Form2.Text1.FontSize = 8
End Sub
Private Sub a2_Click()
Form2.Show
Form2.Text1.FontSize = 10
End Sub
Private Sub a3_Click()
Form2.Show
Form2.Text1.FontSize = 12
End Sub
Private Sub a4_Click()
Form2.Show
Form2.Text1.FontSize = 14
End Sub
Private Sub a5_Click()
Form2.Show
Form2.Text1.FontSize = 16
End Sub
Private Sub bo_Click()
Form2.Show
Form2.Text1.FontBold = True
End Sub
Private Sub col_Click()
Form2.Show
CommonDialog1.Flags = cdlCCRGBInit
CommonDialog1.ShowColor
Form2.Text1.ForeColor = CommonDialog1.Color
End Sub
Private Sub exit_Click()
End
End Sub
Private Sub Form_MouseUp(Button As Integer, shift As Integer, x As Single, y As Single)
If Button = 2 Then
PopupMenu font1, , , , ita
PopupMenu a
End If
End Sub
Private Sub ita_Click()
Form2.Show
Form2.Text1.FontItalic = True
End Sub
Private Sub open_Click()
Form2.Show
Dim filename As String
CommonDialog1.Filter = "text_files(*.txt)|*.txt"
CommonDialog1.ShowOpen
filename = CommonDialog1.filename
openfile filename
End Sub
Private Sub under_Click()
Form2.Show
Form2.Text1.FontUnderline = True
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?