home *** CD-ROM | disk | FTP | other *** search
- Type APIFindMasterForm From SampleMasterForm
- Dim btnFind As New Button
- Dim Label1 As New Label
- Dim Label2 As New Label
- Dim txtSearchString As New TextBox
- Dim txtSearchBox As New TextBox
- Dim FindPanel As New FindDialog
-
- ' METHODS for object: APIFindMasterForm
- Sub btnFind_Click()
- If txtSearchString.Text == "" Then
- InfoBox.Message("Warning", "No search string specified!")
- txtSearchString.SetFocus
- Exit Sub
- End If
-
- ' Hide some items on the FindDialog panel
- FindPanel.HideMatchCase = "True"
- FindPanel.HideUpDown = "True"
- FindPanel.HideWholeWord = "True"
- FindPanel.FindString = txtSearchString.Text
-
- ' Post the find panel
- FindPanel.Show
-
- End Sub
-
- Sub FindPanel_Find()
- Dim loc As Integer
-
- ' The FindPanel invokes a Find method when the FindNext button is clicked
- loc = Instr(txtSearchBox.SelStart + 1 + txtSearchBox.SelLength, txtSearchBox.Text, FindPanel.FindString)
- If loc Then
- txtSearchBox.SelStart = loc - 1
- txtSearchBox.SelLength = Len(FindPanel.FindString)
- txtSearchBox.SetFocus
- Else
- InfoBox.Message("", "Cannot find '" & FindPanel.FindString & "'")
- End If
- End Sub
-
- Sub ResetApplication_Click ()
-
- Dim newline As String
- Dim tmpstring As String
-
- newline = Chr(13) & Chr(10)
-
- ' Initialize Find Dialog Demonstration
- tmpstring = "Sometimes, when you are feeling important," & newline
- tmpstring = tmpstring & "Sometimes, when your ego's in bloom," & newline
- tmpstring = tmpstring & "Sometimes, when you take it for granted" & newline
- tmpstring = tmpstring & "You're the best qualified in the room." & newline
- tmpstring = tmpstring & newline
- tmpstring = tmpstring & "Sometime, when you feel that your going" & newline
- tmpstring = tmpstring & "Would leave an un-fillable hole," & newline
- tmpstring = tmpstring & "Just follow this simple instruction" & newline
- tmpstring = tmpstring & "And see how it humbles your soul." & newline
- tmpstring = tmpstring & newline
- tmpstring = tmpstring & "Take a bucket and fill it with water," & newline
- tmpstring = tmpstring & "Put your hand in it, up to your wrist," & newline
- tmpstring = tmpstring & "Pull it out, and the hole that's remaining" & newline
- tmpstring = tmpstring & "Is a measure of how much you'll be missed." & newline
- tmpstring = tmpstring & newline
- tmpstring = tmpstring & "You may splash all you please when you enter," & newline
- tmpstring = tmpstring & "You can stir up the water galore," & newline
- tmpstring = tmpstring & "But stop and you'll find in a minute" & newline
- tmpstring = tmpstring & "That it looks quite the same as before." & newline
- tmpstring = tmpstring & newline
- tmpstring = tmpstring & "The moral in this quaint example" & newline
- tmpstring = tmpstring & "Is do just the best that you can," & newline
- tmpstring = tmpstring & "Be proud of yourself, but remember," & newline
- tmpstring = tmpstring & "There is no indispensable man." & newline
-
- ' Set the default textbox attributes
- txtSearchBox.MultiLine = "True"
- txtSearchBox.ScrollBars = 2
-
- ' Put the test string in the textbox
- txtSearchBox.Text = tmpstring
-
- ' Set a default search string
- txtSearchString.Text = ""
-
- txtSearchString.SetFocus
-
- End Sub
-
- End Type
-
- Begin Code
- ' Reconstruction commands for object: APIFindMasterForm
- '
- With APIFindMasterForm
- .Caption := "Windows Find Dialog Demonstration"
- .Move(4995, 1140, 6885, 5490)
- .CurrentY := 16
- .SampleDir := "W:\Examples\apifind\"
- .SampleName := "apifind"
- With .btnFind
- .Caption := "Find"
- .Move(5400, 600, 1050, 450)
- End With 'APIFindMasterForm.btnFind
- With .Label1
- .Caption := "1. Key in a search string, then click Find button."
- .ForeColor := 13107200
- .Move(300, 300, 4800, 300)
- End With 'APIFindMasterForm.Label1
- With .Label2
- .Caption := "Search For:"
- .Move(450, 750, 1200, 300)
- End With 'APIFindMasterForm.Label2
- With .txtSearchString
- .Move(1800, 750, 3300, 360)
- End With 'APIFindMasterForm.txtSearchString
- With .txtSearchBox
- .Move(450, 1350, 5850, 3150)
- .WordWrap := True
- .ScrollBars := "Vertical"
- .MultiLine := True
- End With 'APIFindMasterForm.txtSearchBox
- With .FindPanel
- .FindString := "best"
- .HideUpDown := True
- .HideMatchCase := True
- .HideWholeWord := True
- End With 'APIFindMasterForm.FindPanel
- With .helpfile
- .FileName := "W:\Examples\apifind\apifind.hlp"
- End With 'APIFindMasterForm.helpfile
- End With 'APIFindMasterForm
- End Code
-