This repository has been archived by the owner on Jan 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
frmFindReplace.frm
201 lines (190 loc) · 5.33 KB
/
frmFindReplace.frm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
VERSION 5.00
Begin VB.Form frmFind
BorderStyle = 4 'Fixed ToolWindow
Caption = "Íàéòè"
ClientHeight = 1395
ClientLeft = 45
ClientTop = 315
ClientWidth = 6105
BeginProperty Font
Name = "Book Antiqua"
Size = 11.25
Charset = 204
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1395
ScaleWidth = 6105
ShowInTaskbar = 0 'False
StartUpPosition = 1 'CenterOwner
Begin VB.CommandButton cmdCancel
Caption = "Îòìåíà"
BeginProperty Font
Name = "Tahoma"
Size = 9.75
Charset = 204
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 4920
TabIndex = 5
Top = 480
Width = 1095
End
Begin VB.ComboBox cmbDest
BeginProperty Font
Name = "Tahoma"
Size = 9.75
Charset = 204
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
ItemData = "frmFindReplace.frx":0000
Left = 1680
List = "frmFindReplace.frx":000D
Style = 2 'Dropdown List
TabIndex = 1
Top = 960
Width = 1140
End
Begin VB.CommandButton cmdNext
Caption = "Äàëåå"
BeginProperty Font
Name = "Tahoma"
Size = 9.75
Charset = 204
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 4920
TabIndex = 2
Top = 150
Width = 1095
End
Begin VB.TextBox txtFind
BeginProperty Font
Name = "Times New Roman"
Size = 9.75
Charset = 204
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 690
Left = 1080
MultiLine = -1 'True
ScrollBars = 2 'Âåðòèêàëü
TabIndex = 0
Top = 150
Width = 3735
End
Begin VB.Label lbl
AutoSize = -1 'True
BackStyle = 0 'Ïðîçðà÷íî
Caption = "Íàïðàâëåíèå:"
Height = 300
Index = 1
Left = 120
TabIndex = 4
Top = 960
Width = 1455
End
Begin VB.Label lbl
AutoSize = -1 'True
BackStyle = 0 'Ïðîçðà÷íî
Caption = "Èñêàòü:"
Height = 300
Index = 0
Left = 120
TabIndex = 3
Top = 120
Width = 795
End
End
Attribute VB_Name = "frmFind"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim blnPressed As Boolean
Private Sub cmbDest_Change()
blnPressed = False
End Sub
Private Sub cmbDest_Click()
blnPressed = False
End Sub
Private Sub cmdCancel_Click()
Me.Hide
End Sub
Private Sub cmdNext_Click()
FindNext
End Sub
Sub FindNext()
If txtFind = "" Then Exit Sub
If (blnPressed And cmbDest.Text = "Âñå") Or cmbDest.Text = "Âíèç" Then
FindDown
ElseIf cmbDest.Text = "Âñå" Then
FindAll
ElseIf cmbDest.Text = "Ââåðõ" Then
FindUp
End If
blnPressed = True
End Sub
Sub FindDown()
With frmMain.txtMain
n = InStr(.SelStart + 2, .Text, txtFind, vbTextCompare)
If n = 0 Then ShowEndMsg: Exit Sub
.SelStart = n - 1
.SelLength = Len(txtFind)
frmMain.SetFocus
.SetFocus
End With
End Sub
Sub FindUp()
With frmMain.txtMain
n = InStrRev(.Text, txtFind, .SelStart, vbTextCompare)
If n = 0 Then ShowEndMsg: Exit Sub
.SelStart = n - 1
.SelLength = Len(txtFind)
frmMain.SetFocus
.SetFocus
End With
End Sub
Sub FindAll()
With frmMain.txtMain
n = InStr(1, .Text, txtFind, vbTextCompare)
If n = 0 Then ShowEndMsg: Exit Sub
.SelStart = n - 1
.SelLength = Len(txtFind)
frmMain.SetFocus
.SetFocus
End With
End Sub
Sub ShowEndMsg()
MsgBox "Ïîèñê çàâåðøåí", vbInformation
End Sub
Sub SetFalsePressed()
blnPressed = False
End Sub
Sub ShowMe()
blnPressed = False
If txtFind = "" Then txtFind = frmMain.txtMain.SelText
If cmbDest.Text = "" Then cmbDest.Text = "Âñå"
Me.Show , frmMain
End Sub