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

📄 not2.frm

📁 vb6.0编程实例详解,很详细的介绍,对学习VB有帮助
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{38911DA0-E448-11D0-84A3-00DD01104159}#1.1#0"; "COMCT332.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form Form1 
   Caption         =   "记事本"
   ClientHeight    =   4710
   ClientLeft      =   165
   ClientTop       =   735
   ClientWidth     =   6615
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   ScaleHeight     =   4710
   ScaleWidth      =   6615
   StartUpPosition =   3  '窗口缺省
   Begin MSComctlLib.ImageList ImageDisable 
      Left            =   5640
      Top             =   2400
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   20
      ImageHeight     =   19
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   4
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Not2.frx":0000
            Key             =   "Cut"
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Not2.frx":05D0
            Key             =   "Copy"
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Not2.frx":0BA0
            Key             =   "Paste"
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Not2.frx":1170
            Key             =   "Undo"
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.ImageList ImageDown 
      Left            =   4920
      Top             =   2400
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   20
      ImageHeight     =   19
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   7
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Not2.frx":1740
            Key             =   "New"
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Not2.frx":1D10
            Key             =   "Open"
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Not2.frx":22E0
            Key             =   "Save"
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Not2.frx":28B0
            Key             =   "Cut"
         EndProperty
         BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Not2.frx":2E80
            Key             =   "Copy"
         EndProperty
         BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Not2.frx":3450
            Key             =   "Paste"
         EndProperty
         BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Not2.frx":3A20
            Key             =   "Undo"
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.ImageList ImageUp 
      Left            =   4200
      Top             =   2400
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   20
      ImageHeight     =   19
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   7
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Not2.frx":3FF0
            Key             =   "New"
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Not2.frx":45C0
            Key             =   "Open"
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Not2.frx":4B90
            Key             =   "Save"
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Not2.frx":5160
            Key             =   "Cut"
         EndProperty
         BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Not2.frx":5730
            Key             =   "Copy"
         EndProperty
         BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Not2.frx":5D00
            Key             =   "Paste"
         EndProperty
         BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Not2.frx":62D0
            Key             =   "Undo"
         EndProperty
      EndProperty
   End
   Begin ComCtl3.CoolBar CoolBar1 
      Height          =   765
      Left            =   240
      TabIndex        =   1
      Top             =   600
      Width           =   6255
      _ExtentX        =   11033
      _ExtentY        =   1349
      BandCount       =   5
      _CBWidth        =   6255
      _CBHeight       =   765
      _Version        =   "6.0.8169"
      Child1          =   "Picture1"
      MinWidth1       =   3000
      MinHeight1      =   375
      Width1          =   3000
      NewRow1         =   0   'False
      AllowVertical1  =   0   'False
      Caption2        =   "查找:"
      Child2          =   "FindText"
      MinHeight2      =   270
      Width2          =   1560
      NewRow2         =   0   'False
      AllowVertical2  =   0   'False
      Caption3        =   "字体:"
      Child3          =   "ComboFont"
      MinHeight3      =   300
      Width3          =   2400
      NewRow3         =   -1  'True
      AllowVertical3  =   0   'False
      Caption4        =   "大小:"
      Child4          =   "ComboSize"
      MinHeight4      =   300
      Width4          =   1545
      NewRow4         =   0   'False
      Child5          =   "Picture2"
      MinHeight5      =   255
      Width5          =   1575
      NewRow5         =   0   'False
      AllowVertical5  =   0   'False
      Begin VB.ComboBox ComboSize 
         Height          =   300
         ItemData        =   "Not2.frx":68A0
         Left            =   3195
         List            =   "Not2.frx":68DD
         TabIndex        =   5
         Text            =   "10.5"
         Top             =   435
         Width           =   750
      End
      Begin VB.ComboBox ComboFont 
         Height          =   300
         ItemData        =   "Not2.frx":692F
         Left            =   765
         List            =   "Not2.frx":6931
         TabIndex        =   4
         Text            =   "宋体"
         Top             =   435
         Width           =   1605
      End
      Begin VB.TextBox FindText 
         Height          =   270
         Left            =   3990
         TabIndex        =   3
         Top             =   75
         Width           =   2175
      End
      Begin VB.PictureBox Picture1 
         BorderStyle     =   0  'None
         Height          =   375
         Left            =   165
         ScaleHeight     =   375
         ScaleWidth      =   3000
         TabIndex        =   2
         Top             =   30
         Width           =   3000
         Begin VB.Label Label1 
            Caption         =   "帮助文本"
            Height          =   200
            Left            =   3240
            TabIndex        =   6
            Top             =   100
            Width           =   1935
         End
         Begin VB.Image ImgUndo 
            Appearance      =   0  'Flat
            Enabled         =   0   'False
            Height          =   285
            Left            =   2640
            ToolTipText     =   "取消修改"
            Top             =   50
            Width           =   300
         End
         Begin VB.Image ImgPaste 
            Appearance      =   0  'Flat
            Height          =   285
            Left            =   2040
            ToolTipText     =   "粘贴"
            Top             =   50
            Width           =   300
         End
         Begin VB.Image ImgCopy 
            Appearance      =   0  'Flat
            Height          =   285
            Left            =   1680
            ToolTipText     =   "复制"
            Top             =   50
            Width           =   300
         End
         Begin VB.Image ImgSave 
            Appearance      =   0  'Flat
            Height          =   285
            Left            =   720
            ToolTipText     =   "保存文件"
            Top             =   50
            Width           =   300
         End
         Begin VB.Image ImgOpen 
            Appearance      =   0  'Flat
            Height          =   285
            Left            =   360
            ToolTipText     =   "打开文件"
            Top             =   50
            Width           =   300
         End
         Begin VB.Image ImgNew 
            Appearance      =   0  'Flat
            Height          =   285
            Left            =   0
            ToolTipText     =   "新建"
            Top             =   50
            Width           =   300
         End
         Begin VB.Image ImgCut 
            Appearance      =   0  'Flat
            Height          =   285
            Left            =   1320
            ToolTipText     =   "剪切"
            Top             =   50
            Width           =   300
         End
      End
   End
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   5640
      Top             =   1560
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
      Color           =   16777215
      DefaultExt      =   "TXT"
      DialogTitle     =   "文件"
      Filter          =   "文本文件 (*.txt)|*.txt|所有文件 (*.*)|*.*"
      FontName        =   "宋体"
      FontSize        =   10.5
      InitDir         =   "."
   End
   Begin VB.TextBox Text1 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   2415
      HideSelection   =   0   'False
      Left            =   360
      MaxLength       =   32768
      MultiLine       =   -1  'True
      ScrollBars      =   3  'Both
      TabIndex        =   0
      Top             =   1680
      Width           =   3495
   End
   Begin VB.Menu File 
      Caption         =   "文件"
      Begin VB.Menu New 
         Caption         =   "新建(&N)"
      End
      Begin VB.Menu Open 
         Caption         =   "打开(&O)"
      End
      Begin VB.Menu Save 
         Caption         =   "保存(&S)"
      End
      Begin VB.Menu Close 
         Caption         =   "关闭(&C)"
      End
      Begin VB.Menu Sep1 
         Caption         =   "-"
      End
      Begin VB.Menu Exit 
         Caption         =   "退出"
         Shortcut        =   ^X
      End
   End
   Begin VB.Menu Edit 
      Caption         =   "编辑"
      Begin VB.Menu Cut 
         Caption         =   "剪切"
      End
      Begin VB.Menu Copy 
         Caption         =   "复制"
      End
      Begin VB.Menu Paste 
         Caption         =   "粘贴"
      End
      Begin VB.Menu Delete 
         Caption         =   "删除"
      End
      Begin VB.Menu Sep2 
         Caption         =   "-"
      End
      Begin VB.Menu DataTime 
         Caption         =   "日期/时间"
      End
   End
   Begin VB.Menu Option 
      Caption         =   "选项"
      Begin VB.Menu Box 
         Caption         =   "工具栏"
         Checked         =   -1  'True
      End
      Begin VB.Menu Sep4 
         Caption         =   "-"
      End
      Begin VB.Menu Fontcolor 
         Caption         =   "字体颜色"
      End
      Begin VB.Menu BackColor 
         Caption         =   "背景色"
      End
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim FileName As String '文件名,用于打开、保存文件
Dim UndoString As String '用于 Undo 操作
Dim UndoNew As String '用于 Undo 操作

Private Sub ImgUndoDisable()
'禁用“Undo”按钮
    UndoString = ""
    UndoNew = ""
    ImgUndo.Enabled = False
    ImgUndo.Picture = ImageDisable.ListImages("Undo").Picture
End Sub

Private Sub ImgUndoEnable()
'有效“Undo”按钮
    ImgUndo.Enabled = True
    ImgUndo.Picture = ImageUp.ListImages("Undo").Picture
End Sub

Private Sub Check_ImgPaste()
'设置粘贴按钮
    If Len(Clipboard.GetText) > 0 Then
        ImgPaste.Enabled = True
        ImgPaste.Picture = ImageUp.ListImages("Paste").Picture
    Else
        ImgPaste.Enabled = False
        ImgPaste.Picture = ImageDisable.ListImages("Paste").Picture
    End If
End Sub

Private Sub Check_ImgCutCopy()
'设置剪切、复制按钮
    If Text1.SelLength > 0 Then
        ImgCut.Enabled = True
        ImgCut.Picture = ImageUp.ListImages("Cut").Picture
        ImgCopy.Enabled = True
        ImgCopy.Picture = ImageUp.ListImages("Copy").Picture
    Else
        ImgCut.Enabled = False
        ImgCut.Picture = ImageDisable.ListImages("Cut").Picture
        ImgCopy.Enabled = False
        ImgCopy.Picture = ImageDisable.ListImages("Copy").Picture
    End If
End Sub
Private Sub BackColor_Click()
    CommonDialog1.ShowColor
    Text1.BackColor = CommonDialog1.Color
End Sub

Private Sub Box_Click()
'显停工具栏
    If Box.Checked Then
    '将停显工具栏
        Box.Checked = False
        CoolBar1.Visible = False
    Else
        Box.Checked = True
        CoolBar1.Visible = True
    End If
    
    Form_Resize '重新调整控件位置
End Sub

Private Sub Close_Click()
    Dim FileNum As Integer
    
    If Len(FileName) > 0 Then
    '有输入文件名
        FileNum = FreeFile() '获得可用文件号

⌨️ 快捷键说明

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