Searches the text in the RichTextBox control for a specified string starting at a specified location.
Syntax
Visual Basic (Declaration) | |
---|
Public Overloads Function Find( _
ByVal str As System.String, _
ByVal start As System.Integer _
) As System.Integer |
C# | |
---|
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
Example
C# | Copy Code |
---|
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;
}
} |
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("excellent", 15) = -1 Then
Me.txtAward.Visible = True
Else
Me.txtAward.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