📄 frmfindreplace.frm
字号:
VERSION 5.00
Begin VB.Form frmFindReplace
BorderStyle = 3 'Fixed Dialog
Caption = "Find and Replace"
ClientHeight = 2040
ClientLeft = 45
ClientTop = 330
ClientWidth = 5415
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2040
ScaleWidth = 5415
ShowInTaskbar = 0 'False
StartUpPosition = 1 'CenterOwner
Begin VB.Frame FramReplace
Caption = "Replace"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1815
Left = 360
TabIndex = 11
Top = 360
Width = 5175
Begin VB.TextBox txtReplace
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 1440
TabIndex = 7
Top = 720
Width = 3495
End
Begin VB.TextBox txtFindR
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 1440
TabIndex = 5
Top = 292
Width = 3495
End
Begin VB.CommandButton cmdCancelR
Caption = "Cancel"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 3840
TabIndex = 9
Top = 1320
Width = 1095
End
Begin VB.CommandButton cmdReplace
Caption = "&Replace"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 2640
TabIndex = 8
Top = 1320
Width = 1095
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "Replace w&ith :"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Left = 240
TabIndex = 6
Top = 795
Width = 1065
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "Fi&nd what :"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Left = 240
TabIndex = 4
Top = 360
Width = 855
End
End
Begin VB.Frame framFind
Caption = "Find"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1815
Left = 120
TabIndex = 10
Top = 120
Width = 5175
Begin VB.CommandButton cmdFind
Caption = "&Find Next"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 2640
TabIndex = 2
Top = 1320
Width = 1095
End
Begin VB.CommandButton cmdCancel
Caption = "Cancel"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 3840
TabIndex = 3
Top = 1320
Width = 1095
End
Begin VB.TextBox txtFind
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 1200
TabIndex = 1
Top = 292
Width = 3735
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "Fi&nd what :"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Left = 240
TabIndex = 0
Top = 360
Width = 855
End
End
End
Attribute VB_Name = "frmFindReplace"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdCancelR_Click()
Unload Me
End Sub
Private Sub cmdFind_Click()
Dim currPos As Integer
currPos = MDIfrm.ActiveForm.Document_.SelStart
currPos = InStr(currPos + 2, MDIfrm.ActiveForm.Document_.Text, txtFind.Text)
If currPos = 0 Then
MsgBox "Mywordy has finished searching the document. The search item was not found.", vbInformation
MDIfrm.ActiveForm.Document_.SelStart = 0
MDIfrm.ActiveForm.Document_.SelLength = 0
Else
MDIfrm.ActiveForm.Document_.SelStart = currPos - 1
MDIfrm.ActiveForm.Document_.SelLength = Len(txtFind.Text)
End If
MDIfrm.ActiveForm.Document_.SetFocus
End Sub
Public Sub loadfind()
MDIfrm.ActiveForm.Document_.SelStart = 0
framFind.Top = 120
framFind.Left = 120
framFind.Visible = True
cmdFind.Default = True
cmdCancel.Cancel = True
FramReplace.Visible = False
End Sub
Public Sub loadReplace()
MDIfrm.ActiveForm.Document_.SelStart = 0
FramReplace.Top = 120
FramReplace.Left = 120
FramReplace.Visible = True
cmdReplace.Default = True
cmdCancelR.Cancel = True
framFind.Visible = False
End Sub
Private Sub cmdReplace_Click()
Dim currPos As Integer
currPos = MDIfrm.ActiveForm.Document_.SelStart
currPos = InStr(currPos + 2, MDIfrm.ActiveForm.Document_.Text, txtFind.Text)
If currPos = 0 Then
MsgBox "Mywordy has finished searching the document. The search item was not found.", vbInformation
MDIfrm.ActiveForm.Document_.SelStart = 0
MDIfrm.ActiveForm.Document_.SelLength = 0
Else
MDIfrm.ActiveForm.Document_.Text = FastReplace(MDIfrm.ActiveForm.Document_.Text & " ", txtFindR.Text, txtReplace.Text)
MDIfrm.ActiveForm.Document_.SetFocus
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -