私のコードはなぜ機能しないのですか?C#関数の問題を発見しました(ハイライトできません)
現在、私はユーザーが入力した単語を見つけることができますが、richTextBoxConversationの単語を強調表示することはできません。
どうすればいいですか?続き
は私のコードです:
private void buttonTextFilter_Click(object sender, EventArgs e)
{
string s1 = richTextBoxConversation.Text.ToLower();
string s2 = textBoxTextFilter.Text.ToLower();
if (s1.Contains(s2))
{
MessageBox.Show("Word found!");
richTextBoxConversation.Find(s2);
}
else
{
MessageBox.Show("Word not found!");
}
}
RichTextBox.Find()から返された値で何かする必要がありますか? – ddrace