ActiveReports 9
Find(String,Int32) Method
Example 

The text to locate in the control.
The location within the control's text at which to begin searching.
Searches the text in the RichTextBox control for a specified string starting at a specified location.
Syntax
'Declaration
 
Public Overloads Function Find( _
   ByVal str As System.String, _
   ByVal start As System.Integer _
) As System.Integer
public System.int Find( 
   System.string str,
   System.int start
)

Parameters

str
The text to locate in the control.
start
The location within the control's text at which to begin searching.

Return Value

The location within the control where the search text was found.
Remarks

The Find method searches for the text specified in the str parameter and returns the location of the first character within the control. If the property returns a negative value, the text string being searched for was not found within the contents of the control.

Note   The Find methods that accept a string as a parameter cannot find text that is contained on more than one line of text within the RichTextBox.  Performing such a search will return a value of negative one (-1).
Example
private void Detail_Format(object sender, System.EventArgs eArgs)
{
    if (this.RichTextBox1.Find("excellent", 15)!= -1)
    {
        this.txtAward.Visible=true;
    }
    else
    {
        this.txtAward.Visible=false;
    }
}
Private Sub Detail_Format(ByVal sender As Object, ByVal e As System.EventArgs) Handles Detail.Format
    If Not Me.RichTextBox1.Find("excellent", 15) = -1 Then
        Me.txtAward.Visible = True
    Else
        Me.txtAward.Visible = False
    End If
End Sub
See Also

Reference

RichTextBox Class
RichTextBox Members
Overload List

 

 


Copyright © 2016 GrapeCity, inc. All rights reserved

Support Forum