📄 yxw5.frm
字号:
VERSION 5.00
Begin VB.Form EditFind
BorderStyle = 3 'Fixed Dialog
Caption = "查找和替换"
ClientHeight = 3195
ClientLeft = 1815
ClientTop = 2895
ClientWidth = 7455
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3195
ScaleWidth = 7455
ShowInTaskbar = 0 'False
Visible = 0 'False
Begin VB.Frame Frame1
BorderStyle = 0 'None
Height = 2535
Left = 240
TabIndex = 0
Top = 360
Width = 6975
Begin VB.OptionButton down
Caption = "向下"
Height = 375
Left = 5400
TabIndex = 10
Top = 720
Value = -1 'True
Width = 855
End
Begin VB.OptionButton up
Caption = "向上"
Height = 375
Left = 5400
TabIndex = 9
Top = 240
Width = 735
End
Begin VB.CommandButton cmdcancel1
Caption = "取消 "
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 5160
TabIndex = 8
Top = 1560
Width = 1095
End
Begin VB.CommandButton cmdfindnext1
Caption = "查找"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3360
TabIndex = 7
Top = 1560
Width = 1095
End
Begin VB.CommandButton cmdreplaceall
Caption = "全部替换"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1800
TabIndex = 6
Top = 1560
Width = 1095
End
Begin VB.CommandButton cmdreplace
Caption = "替换"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 240
TabIndex = 5
Top = 1560
Width = 1095
End
Begin VB.ComboBox Combo2
Height = 315
Left = 1080
TabIndex = 4
Top = 720
Width = 3855
End
Begin VB.ComboBox Combo1
Height = 315
Left = 1080
TabIndex = 2
Top = 240
Width = 3855
End
Begin VB.Label Label3
Caption = "替换为:"
Height = 255
Left = 120
TabIndex = 3
Top = 840
Width = 735
End
Begin VB.Label Label2
Caption = "查找内容:"
Height = 255
Left = 120
TabIndex = 1
Top = 240
Width = 975
End
End
End
Attribute VB_Name = "EditFind"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim txtstring As String
Public pos As Integer
Private Sub cmdcancel1_Click()
gFindString = Combo1.Text
Unload EditFind
End Sub
Private Sub cmdfindnext1_Click()
gFindString = Combo1.Text
findnext
EditFind.cmdfindnext1.Enabled = False
Unload EditFind
FoundString = fMainForm.ActiveForm.rtfText.Text
End Sub
Private Sub cmdreplace_Click()
ReplaceFlag = True
Replace
End Sub
Private Sub cmdreplaceall_Click()
Dim ReplaceNum As Integer
Dim stat As Integer
Dim i As Integer
ReplaceFlag = True
ReplaceNum = 0
Do
findnext
If Finding = False Then
Exit Do
End If
ReplaceNum = ReplaceNum + 1
Loop While Finding
If ReplaceNum = 0 Then
Exit Sub
End If
Direction = Not Direction
stat = MsgBox("查找到" & ReplaceNum & FindString & "," & "要替换所有吗?", vbYesNo, "替换")
If stat = 6 Then
For i = 1 To ReplaceNum
Replace
Next
Else
Exit Sub
End If
End Sub
Private Sub Combo1_Change()
If Combo1.Text = "" Then
cmdfindnext1.Enabled = False
Else
cmdfindnext1.Enabled = True
FindString = Combo1.Text
End If
End Sub
Private Sub down_Click()
Direction = 1
End Sub
Private Sub Form_Load()
Frame1.Left = EditFind.ScaleLeft
Frame1.Top = EditFind.ScaleTop
Frame1.Width = EditFind.ScaleWidth
Frame1.Height = EditFind.ScaleHeight
EditFind.Left = fMainForm.Width / 5
EditFind.Top = fMainForm.Height / 3
gFindString = ""
Combo2.Text = ""
Finding = False
Direction = 1
ReplaceFlag = False
End Sub
Private Sub up_Click()
Direction = 0
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -