⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmmain.frm

📁 类似WORD的文字编辑器
💻 FRM
📖 第 1 页 / 共 3 页
字号:
      BorderStyle     =   1
      Begin VB.Frame Frame1 
         Height          =   500
         Left            =   0
         TabIndex        =   3
         Top             =   -120
         Width           =   4815
         Begin VB.ComboBox Combo2 
            Height          =   300
            Left            =   2400
            TabIndex        =   6
            Top             =   150
            Width           =   975
         End
         Begin VB.ComboBox Combo1 
            Height          =   300
            Left            =   600
            TabIndex        =   5
            Top             =   150
            Width           =   1215
         End
         Begin VB.TextBox Text1 
            Height          =   270
            Left            =   4080
            TabIndex        =   4
            Top             =   165
            Width           =   375
         End
         Begin MSForms.SpinButton SpinButton1 
            Height          =   270
            Left            =   4440
            TabIndex        =   10
            Top             =   165
            Width           =   255
            Size            =   "450;476"
         End
         Begin VB.Label Label3 
            Caption         =   "位置"
            Height          =   255
            Left            =   3600
            TabIndex        =   9
            Top             =   180
            Width           =   375
         End
         Begin VB.Label Label1 
            Caption         =   "大小"
            Height          =   255
            Left            =   1920
            TabIndex        =   8
            Top             =   180
            Width           =   495
         End
         Begin VB.Label Label2 
            Caption         =   "格式"
            Height          =   255
            Left            =   120
            TabIndex        =   7
            Top             =   173
            Width           =   495
         End
      End
      Begin MSComctlLib.Toolbar Toolbar2 
         Height          =   390
         Index           =   1
         Left            =   4920
         TabIndex        =   2
         Top             =   0
         Width           =   4440
         _ExtentX        =   7832
         _ExtentY        =   688
         ButtonWidth     =   609
         ButtonHeight    =   582
         Appearance      =   1
         ImageList       =   "imlToolbarIcons(4)"
         _Version        =   393216
         BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
            NumButtons      =   14
            BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Key             =   "Explorer"
               ImageKey        =   "EXPLORER"
            EndProperty
            BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Key             =   "IE"
               ImageKey        =   "IE"
            EndProperty
            BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Key             =   "Mail"
               ImageKey        =   "Mail"
            EndProperty
            BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Key             =   "Adress"
               ImageKey        =   "Adress"
            EndProperty
            BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Key             =   "Notepad"
               ImageKey        =   "NOTEPAD"
            EndProperty
            BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Key             =   "Acdsee"
               ImageKey        =   "ACDSEE"
            EndProperty
            BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Style           =   3
            EndProperty
            BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Key             =   "Time"
               ImageKey        =   "Time1"
            EndProperty
            BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Key             =   "Key"
               ImageKey        =   "Key"
               Style           =   2
            EndProperty
            BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Key             =   "Lockup"
               ImageKey        =   "Lockup"
               Style           =   2
            EndProperty
            BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Key             =   "partlock"
               ImageKey        =   "part"
               Style           =   1
            EndProperty
            BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Key             =   "Cover"
               ImageKey        =   "X"
               Style           =   1
            EndProperty
            BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Style           =   3
            EndProperty
            BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Key             =   "Help"
               ImageKey        =   "Help"
            EndProperty
         EndProperty
      End
   End
   Begin MSComctlLib.StatusBar StatusBar1 
      Align           =   2  'Align Bottom
      Height          =   345
      Left            =   0
      TabIndex        =   11
      Top             =   6165
      Width           =   9480
      _ExtentX        =   16722
      _ExtentY        =   609
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   10
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   4410
            MinWidth        =   4410
         EndProperty
         BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Alignment       =   1
            Object.Width           =   2117
            MinWidth        =   2117
         EndProperty
         BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Enabled         =   0   'False
            Object.Width           =   1413
            MinWidth        =   1413
         EndProperty
         BeginProperty Panel4 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   1411
            MinWidth        =   1411
         EndProperty
         BeginProperty Panel5 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Style           =   6
            Alignment       =   1
            Object.Width           =   1764
            MinWidth        =   1764
            TextSave        =   "99-12-8"
         EndProperty
         BeginProperty Panel6 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Style           =   5
            Alignment       =   1
            Object.Width           =   1236
            MinWidth        =   1236
            TextSave        =   "22:24"
         EndProperty
         BeginProperty Panel7 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Style           =   1
            Alignment       =   1
            Enabled         =   0   'False
            Object.Width           =   970
            MinWidth        =   970
            TextSave        =   "CAPS"
         EndProperty
         BeginProperty Panel8 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Style           =   2
            Alignment       =   1
            Object.Width           =   970
            MinWidth        =   970
            TextSave        =   "NUM"
         EndProperty
         BeginProperty Panel9 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Style           =   3
            Alignment       =   1
            Enabled         =   0   'False
            Object.Width           =   970
            MinWidth        =   970
            TextSave        =   "Ins"
         EndProperty
         BeginProperty Panel10 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Style           =   4
            Alignment       =   1
            Enabled         =   0   'False
            Object.Width           =   971
            MinWidth        =   971
            TextSave        =   "SCRL"
         EndProperty
      EndProperty
   End
   Begin VB.Menu mnuFile 
      Caption         =   "1000"
      Begin VB.Menu mnuFileNew 
         Caption         =   "1001"
         Shortcut        =   ^N
      End
      Begin VB.Menu mnuFileOpen 
         Caption         =   "1002"
         Shortcut        =   ^O
      End
      Begin VB.Menu mnuFileClose 
         Caption         =   "1003"
      End
      Begin VB.Menu mnuFileBar0 
         Caption         =   "-"
      End
      Begin VB.Menu mnuFileSave 
         Caption         =   "1004"
      End
      Begin VB.Menu mnuFileSaveAs 
         Caption         =   "1005"
      End
      Begin VB.Menu mnuFileBar1 
         Caption         =   "-"
      End
      Begin VB.Menu mnuFileExit 
         Caption         =   "1006"
      End
   End
   Begin VB.Menu mnuEdit 
      Caption         =   "1007"
      Begin VB.Menu mnuEditCut 
         Caption         =   "1008"
         Shortcut        =   ^X
      End
      Begin VB.Menu mnuEditCopy 
         Caption         =   "1009"
         Shortcut        =   ^C
      End
      Begin VB.Menu mnuEditPaste 
         Caption         =   "1010"
         Shortcut        =   ^V
      End
   End
   Begin VB.Menu mnuWindow 
      Caption         =   "1011"
      WindowList      =   -1  'True
      Begin VB.Menu mnuWindowCascade 
         Caption         =   "1012"
      End
      Begin VB.Menu mnuWindowTileHorizontal 
         Caption         =   "1013"
      End
      Begin VB.Menu mnuWindowTileVertical 
         Caption         =   "1014"
      End
      Begin VB.Menu mnuWindowArrangeIcons 
         Caption         =   "1015"
      End
   End
   Begin VB.Menu mnuHelp 
      Caption         =   "1016"
      Begin VB.Menu mnuHelpContents 
         Caption         =   "1017"
      End
      Begin VB.Menu mnuHelpAbout 
         Caption         =   "1018"
      End
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim flag As Boolean
Dim filepath As String
Dim saveoption As Integer
Dim col As Integer
Dim place As Integer
Dim tempsize As Integer
Dim response As Double
Private Declare Function OSWinHelp% Lib "user32" Alias "WinHelpA" (ByVal hwnd&, ByVal HelpFile$, ByVal wCommand%, dwData As Any)

Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Dim response As Integer
response = MsgBox("确定要关闭窗口吗?", vbYesNo + vbInformation + vbDefaultButton1)
If response = vbNo Then
'用户回答否则通过设置Cancel变元取消关闭操作
Cancel = True
End If

End Sub

Private Sub SpinButton1_Change()

Me.Text1.Text = Me.SpinButton1.Value - 30

End Sub

Private Sub Text1_Change()
On Error Resume Next
If (Me.ActiveForm.RichTextBox1.SelProtected = True) Or IsNull(Me.ActiveForm.RichTextBox1.SelProtected) Then
Call protect
Else
    
    If Not (Me.Text1.Text = "") Then
        Me.ActiveForm.RichTextBox1.SelCharOffset = Me.Text1.Text * 10
        Me.SpinButton1.Value = Me.Text1.Text + 30
    Else
    End If
End If
End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Dim response As Integer
       Select Case Button.Key
        Case "New"
            LoadNewDoc
        Case "Open"
            mnuFileOpen_Click
        Case "Save"
            mnuFileSave_Click
        Case "Print"
            On Error GoTo errhandle:
            Me.ActiveForm.RichTextBox1.SelPrint (Printer.hDC)
errhandle:
            MsgBox Err.Description
        Case "Cut"
            Clipboard.SetText Me.ActiveForm.RichTextBox1.SelText
            Me.ActiveForm.RichTextBox1.SelText = ""
        Case "Copy"
            Clipboard.SetText Me.ActiveForm.RichTextBox1.SelText
        Case "Paste"
            Me.ActiveForm.RichTextBox1.SelText = Clipboard.GetText
        Case "Delete"
            Me.ActiveForm.RichTextBox1.SelText = ""
        'Case 11
        '    Me.ActiveForm.RichTextBox1.Text = history(place - 1)
        '   place = place - 1
        '    If place = 1 Then Me.Toolbar1.Buttons.Item(11).Enabled = False
        '    Me.Toolbar1.Buttons.Item(12).Enabled = True
        '    flag = False
        'Case 12
        '    Me.ActiveForm.RichTextBox1.Text = history(place + 1)
        '    place = place + 1
        '    If place = 10 Then Me.Toolbar1.Buttons.Item(12).Enabled = False
        '    Me.Toolbar1.Buttons.Item(11).Enabled = True
        '    flag = False
        Case "Find"
            frmfind.Show
            frmfind.Enabled = True
        Case "Bold"
            If (Me.ActiveForm.RichTextBox1.SelProtected = True) Or IsNull(Me.ActiveForm.RichTextBox1.SelProtected) Then
            Call protect
            Else

            If Me.Toolbar1.Buttons.Item(13).Value = tbrPressed Then
            Me.ActiveForm.RichTextBox1.SelBold = True
            
            ElseIf Me.Toolbar1.Buttons.Item(13).Value = tbrUnpressed Then
            Me.ActiveForm.RichTextBox1.SelBold = False
            Else
            End If
            
            End If
        Case "Italic"
         If (Me.ActiveForm.RichTextBox1.SelProtected = True) Or IsNull(Me.ActiveForm.RichTextBox1.SelProtected) Then
            Call protect
        Else
            If Me.Toolbar1.Buttons.Item(14).Value = tbrPressed Then
            Me.ActiveForm.RichTextBox1.SelItalic = True
            ElseIf Me.Toolbar1.Buttons.Item(14).Value = tbrUnpressed Then
            Me.ActiveForm.RichTextBox1.SelItalic = False
            Else
            End If

⌨️ 快捷键说明

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