Searches for text in the content of the RichTextBox control.
Overload List
Overload | Description |
Find(Char[]) | Searches the text of a RichTextBox control for the first instance of a character from a list of characters. |
Find(String) | Searches the text of the RichTextBox control for a string. |
Find(String,Int32) | Searches the text in the RichTextBox control for a specified string starting at a specified location. |
Find(String,Int32,FindOptions) | Searches the text in the RichTextBox control for a specified string starting at a specified location and with specific options applied to the search. |
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 |
Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
See Also