home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 13
/
CD_ASCQ_13_0494.iso
/
maj
/
1697
/
samples
/
find.frm
< prev
next >
Wrap
Text File
|
1993-10-13
|
5KB
|
185 lines
VERSION 2.00
Begin Form frmFind
Caption = "Find"
Height = 3120
Left = 720
LinkTopic = "Form2"
ScaleHeight = 2715
ScaleWidth = 4905
Top = 1815
Width = 5025
Begin ComboBox comboText
Height = 300
Left = 1170
TabIndex = 0
Top = 210
Width = 2355
End
Begin Frame Frame4
Caption = "Origin"
Height = 975
Left = 2640
TabIndex = 10
Top = 1380
Width = 2055
Begin OptionButton optOrigin
Caption = "&From Cursor"
Height = 285
Index = 1
Left = 240
TabIndex = 12
Top = 240
Value = -1 'True
Width = 1575
End
Begin OptionButton optOrigin
Caption = "&Entire Scope"
Height = 285
Index = 0
Left = 240
TabIndex = 11
Top = 600
Width = 1575
End
End
Begin Frame Frame1
Caption = "Direction"
Height = 570
Left = 150
TabIndex = 6
Top = 1980
Width = 2145
Begin OptionButton optDirection
Caption = "&Down"
Height = 252
Index = 1
Left = 960
TabIndex = 8
Top = 240
Value = -1 'True
Width = 852
End
Begin OptionButton optDirection
Caption = "&Up"
Height = 252
Index = 0
Left = 240
TabIndex = 7
Top = 240
Width = 612
End
End
Begin CheckBox chkCase
Caption = "Match &Case"
Height = 375
Left = 240
TabIndex = 3
Top = 960
Width = 1455
End
Begin CommandButton cmdcancel
Cancel = -1 'True
Caption = "Cancel"
Height = 372
Left = 3720
TabIndex = 2
Top = 600
Width = 1092
End
Begin CommandButton cmdFind
Caption = "&OK"
Default = -1 'True
Height = 372
Left = 3720
TabIndex = 1
Top = 120
Width = 1092
End
Begin Frame Frame2
Caption = "Options"
Height = 975
Left = 120
TabIndex = 9
Top = 720
Width = 2175
Begin CheckBox chkWholeWords
Caption = "&Whole Words Only"
Height = 315
Left = 120
TabIndex = 4
Top = 600
Width = 1935
End
End
Begin Label Label1
Caption = "Fi&nd What:"
Height = 255
Index = 0
Left = 120
TabIndex = 5
Top = 240
Width = 975
End
End
Option Explicit
Sub cmdCancel_Click ()
' gFindString = comboText.Text
Hide
End Sub
Sub cmdFind_Click ()
Dim TargetText As String
Dim MatchCase As Integer
Dim WholeWordOnly As Integer
Dim UpDirection As Integer
Dim BeginScope As Integer
Dim FoundIt As Integer
' It seems that VB does not let you pass control properties directly, so you are
' preventing from writing...
' FindIt comboText.Text, MatchCase, WholeWordOnly, optScope(0).Value, optDirection(0).Value, optOrigin(0).Value
' ...instead you have to assign the properites to variables and then pass the variables.
' Kinda lame.
TargetText = comboText.Text
BeginScope = optOrigin(0).Value
UpDirection = optDirection(0).Value
If chkCase.Value = 1 Then
MatchCase = True
Else
MatchCase = False
End If
If chkWholeWords.Value = 1 Then
WholeWordOnly = True
Else
WholeWordOnly = False
End If
' gFindString = comboText.Text
UpdateComboList comboText, TargetText ' add text to combo list if not already exists
Hide
FoundIt = FindIt(TargetText, MatchCase, WholeWordOnly, UpDirection, BeginScope, "", False, False)
End Sub
Sub comboText_Change ()
gFirstTime = True
If comboText.Text = "" Then
cmdFind.Enabled = False
Else
cmdFind.Enabled = True
End If
End Sub
Sub Form_Load ()
cmdFind.Enabled = False
'gFindDirection = 1
End Sub
Sub optDirection_Click (index As Integer)
'gFindDirection = index
End Sub