5.16.frm

来自「VB6.0应用例题」· FRM 代码 · 共 119 行

FRM
119
字号
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "简易编辑器"
   ClientHeight    =   2190
   ClientLeft      =   165
   ClientTop       =   735
   ClientWidth     =   5535
   LinkTopic       =   "Form1"
   ScaleHeight     =   2190
   ScaleWidth      =   5535
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text1 
      Height          =   2055
      Left            =   0
      MultiLine       =   -1  'True
      ScrollBars      =   3  'Both
      TabIndex        =   0
      Text            =   "5.16.frx":0000
      Top             =   120
      Width           =   5535
   End
   Begin VB.Line Line2 
      BorderColor     =   &H00FFFFFF&
      X1              =   0
      X2              =   5520
      Y1              =   10
      Y2              =   10
   End
   Begin VB.Line Line1 
      X1              =   0
      X2              =   5520
      Y1              =   0
      Y2              =   0
   End
   Begin VB.Menu mnuFile 
      Caption         =   "文件(&F)"
      Begin VB.Menu mnuFileCls 
         Caption         =   "清除(&C)"
      End
      Begin VB.Menu mnuLine 
         Caption         =   "-"
      End
      Begin VB.Menu mnuFileExit 
         Caption         =   "退出(&X)"
      End
   End
   Begin VB.Menu mnuEdit 
      Caption         =   "编辑(&E)"
      Begin VB.Menu mnuEditColor 
         Caption         =   "颜色(&C)"
         Shortcut        =   ^C
      End
      Begin VB.Menu mnuEditSize 
         Caption         =   "大小(&S)"
         Begin VB.Menu mnuEditSizeArr 
            Caption         =   "12"
            Checked         =   -1  'True
            Index           =   1
         End
         Begin VB.Menu mnuEditSizeArr 
            Caption         =   "16"
            Index           =   2
         End
         Begin VB.Menu mnuEditSizeArr 
            Caption         =   "20"
            Index           =   3
         End
      End
   End
   Begin VB.Menu mnuHelp 
      Caption         =   "帮助(&H)"
      Begin VB.Menu mnuHelpAbort 
         Caption         =   "关于(&A)"
      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 mnuFileCls_Click()
    Text1.Text = ""
End Sub
Private Sub mnuFileExit_Click()   '退出
    Unload Me
End Sub
Private Sub mnuEditColor_Click()  '颜色
    Text1.ForeColor = vbRed    '设为红色
End Sub
Private Sub mnuEditSizeArr_Click(Index As Integer)  '设置字体大小
    For i = 1 To 3
        mnuEditSizeArr(i).Checked = False
    Next i
    Select Case Index
        Case 1
            s = 12
            mnuEditSizeArr(1).Checked = True
        Case 2
            s = 16
            mnuEditSizeArr(2).Checked = True
        Case 3
            s = 20
            mnuEditSizeArr(3).Checked = True
    End Select
    Text1.FontSize = s
End Sub
Private Sub mnuHelpAbort_Click()  '关于
    MsgBox "一个有待完善的简易文本编辑器,版本1.0", vbOKOnly, "版本信息"
End Sub
Private Sub Form_Load()
   Text1.FontSize = 12
End Sub
Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
   If Button = 2 Then
      PopupMenu mnuEdit         '弹出名称为mnuEdit的菜单
   End If
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?