111,101
社区成员




Public Function FindMyText(text As String) As Boolean
' Initialize the return value to false by default.
Dim returnValue As Boolean = False
' Ensure a search string has been specified.
If text.Length > 0 Then
' Obtain the location of the search string in richTextBox1.
Dim indexToText As Integer = richTextBox1.Find(text, RichTextBoxFinds.MatchCase)
' Determine if the text was found in richTextBox1.
If indexToText >= 0 Then
returnValue = True
End If
End If
Return returnValue
End Function
public bool FindMyText(string text)
{
// Initialize the return value to false by default.
bool returnValue = false;
// Ensure a search string has been specified.
if (text.Length > 0)
{
// Obtain the location of the search string in richTextBox1.
int indexToText = richTextBox1.Find(text, RichTextBoxFinds.MatchCase);
// Determine if the text was found in richTextBox1.
if(indexToText >= 0)
{
returnValue = true;
}
}
return returnValue;
}