How to work with Method : Find in richTextBox
-
I want to set two find options : "MachCase" and "WholeWord" this code works correctly :
richTextBox1.Find(StrSearch, RichTextBoxFinds.MatchCase);
but this code doesn`t work; It has compiler Error :richTextBox1.Find(StrSearch, RichTextBoxFinds.MatchCase, RichTextBoxFinds.WholeWord);
How should I write this code to set either RichTextBoxFinds.MatchCase, RichTextBoxFinds.WholeWordHello Friends
-
I want to set two find options : "MachCase" and "WholeWord" this code works correctly :
richTextBox1.Find(StrSearch, RichTextBoxFinds.MatchCase);
but this code doesn`t work; It has compiler Error :richTextBox1.Find(StrSearch, RichTextBoxFinds.MatchCase, RichTextBoxFinds.WholeWord);
How should I write this code to set either RichTextBoxFinds.MatchCase, RichTextBoxFinds.WholeWordHello Friends
Laji59 wrote:
richTextBox1.Find(StrSearch, RichTextBoxFinds.MatchCase, RichTextBoxFinds.WholeWord);
If you noticed, RichTextBox.Find method has two arguments: string str, RichTextBoxFinds option. So you have error. You should ask your user which option he/she wants. MatchCase OR WholeWord
-
Laji59 wrote:
richTextBox1.Find(StrSearch, RichTextBoxFinds.MatchCase, RichTextBoxFinds.WholeWord);
If you noticed, RichTextBox.Find method has two arguments: string str, RichTextBoxFinds option. So you have error. You should ask your user which option he/she wants. MatchCase OR WholeWord
-
I know. But May be an User have either "MachCase" and "WholeWord" even more like "search Foreward or Backward". This ability is also in Standard application like Microsoft Word or Visual Studio
Hello Friends
Well simply search your text with MatchCase if Find can't find anything (returns -1) search for WholeWord.