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

📄 form1.frm

📁 实现系统的文字查找功能 程序短小 精悍 可以在你自己编写的字处理程序中实用
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "基于TextBoxes的查找并替换功能"
   ClientHeight    =   3000
   ClientLeft      =   75
   ClientTop       =   420
   ClientWidth     =   6675
   LinkTopic       =   "Form1"
   Picture         =   "Form1.frx":0000
   ScaleHeight     =   3000
   ScaleWidth      =   6675
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton cmdReplace 
      Caption         =   "替换"
      Height          =   375
      Left            =   5160
      TabIndex        =   6
      Top             =   2160
      Width           =   1215
   End
   Begin VB.TextBox txtReplace 
      Alignment       =   2  'Center
      Height          =   375
      Left            =   3600
      TabIndex        =   5
      Text            =   "[New String]"
      Top             =   2160
      Width           =   1575
   End
   Begin VB.CheckBox Check2 
      Caption         =   "全字匹配"
      Height          =   255
      Left            =   1680
      TabIndex        =   4
      Top             =   2640
      Width           =   1815
   End
   Begin VB.CheckBox Check1 
      Caption         =   "大小写匹配"
      Height          =   495
      Left            =   120
      TabIndex        =   3
      Top             =   2520
      Width           =   1455
   End
   Begin VB.TextBox Text2 
      Alignment       =   2  'Center
      Height          =   375
      Left            =   120
      TabIndex        =   2
      Text            =   "End"
      Top             =   2160
      Width           =   2055
   End
   Begin VB.CommandButton Command1 
      Caption         =   "查找"
      Height          =   375
      Left            =   2280
      TabIndex        =   1
      Top             =   2160
      Width           =   1095
   End
   Begin VB.TextBox Text1 
      Height          =   1935
      Left            =   120
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   0
      Text            =   "Form1.frx":0342
      Top             =   120
      Width           =   6255
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'****************************************************************************
'人人为我,我为人人
'枕善居汉化收藏整理
'发布日期:05/10/30
'描  述:基于TextBoxes的查找并替换功能
'网  站:http://www.mndsoft.com/
'e-mail:mnd@mndsoft.com
'OICQ  : 88382850
'****************************************************************************
Option Explicit
Dim Position  As Integer

Private Sub cmdReplace_Click()

    ' 替换
    If Not Text1.SelLength = 0 Then
        Text1.SelText = txtReplace
    End If
    Command1_Click
    
End Sub

Private Sub Command1_Click()
Dim Match As Boolean, Whole As Boolean
    If Check1.Value = 1 Then Match = True
    If Check2.Value = 1 Then Whole = True
    Position = Find_On(Text1, Position + 1, Text2, Match, Whole)
    If Not Position = 0 Then Command1.Caption = "继续查找(&N)"
    
End Sub

Private Sub Text2_Change()
    Position = -1
    Command1.Caption = "查找"
End Sub

⌨️ 快捷键说明

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