Searches the text of the RichTextBox control for a string.
Syntax
Visual Basic (Declaration) | |
---|
Overloads Public Function Find( _
ByVal str As String _
) As Integer |
Visual Basic (Usage) | Copy Code |
---|
Dim instance As RichTextBox
Dim str As String
Dim value As Integer
value = instance.Find(str)
|
C# | |
---|
public int Find(
string str
) |
Parameters
- str
The text to locate in the control.
Return Value
The location within the control where the search text was found or a negative one (-1) if the search string is not found or an empty search string is specified in the str parameter.
Example
C# | Copy Code |
---|
private void Detail_Format(object
sender, System.EventArgs eArgs)
{
if (this.RichTextBox1.Find("past due")!= -1)
{
this.txtPayNow.Visible=true;
}
else
{
this.txtPayNow.Visible=false;
}
} |
Visual Basic | Copy Code |
---|
Private Sub Detail_Format(ByVal sender As Object, ByVal e As System.EventArgs) Handles Detail.Format
If Not Me.RichTextBox1.Find("past due") = -1 Then
Me.txtPayNow.Visible = True
Else
Me.txtPayNow.Visible = False
End If
End Sub |
Remarks
See Also