ActiveReports.Viewer3 Request technical support
Find Method
See Also  Example


searchString

String to search for in the document.

currentIndex
Starting position of the search.  If the string was found, currentIndex is set to the position where the string was found.
Searches for the specified string in the Document's pages collection.

Syntax

Visual Basic (Declaration) 
Public Function Find( _
   ByVal searchString As String, _
   ByRef currentIndex As Integer _
) As Boolean
Visual Basic (Usage)Copy Code
Dim instance As Document
Dim searchString As String
Dim currentIndex As Integer
Dim value As Boolean
 
value = instance.Find(searchString, currentIndex)
C# 
public bool Find( 
   string searchString,
   ref int currentIndex
)

Parameters

searchString

String to search for in the document.

currentIndex
Starting position of the search.  If the string was found, currentIndex is set to the position where the string was found.

Return Value

A Boolean value. True, if the string was found in the document; otherwise, false.

Example

C#Copy Code
private void btnFind_Click(object sender, System.EventArgs e)
{
   
int i = 0;
   
if (arv.Document.Find("Coyote", ref i) == true)
   {
       MessageBox.Show (
"This document contains the word Coyote.");
       arv.Document.ClearFindTextSelection();
   }
}
Visual BasicCopy Code
Private Sub btnFind_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFind.Click
    If arv.Document.Find("Coyote", 0) Then
        MsgBox("This document contains the word Coyote.")
        arv.Document.ClearFindTextSelection()
    End If
End Sub

Remarks

If found, returns the location of the string in the currentIndex parameter.  To continue searching after the first occurrence, call the method again with the returned currentIndex.

See Also