How do I .MatchCase and .WholeWord?
Posted
by Tanner
on Stack Overflow
See other posts from Stack Overflow
or by Tanner
Published on 2010-05-19T12:53:16Z
Indexed on
2010/05/19
13:00 UTC
Read the original article
Hit count: 168
Hello, Ive been making a find, find next function for my richtextbox, so I have these check boxes to let the user search by whole word or case sensitive or both, and I got the first two, to work but I can't get it to work with both case a whole word checked, here's my code:
if (isWhole == true && isCase == true)
{
string searchText = Form2.text;
this.Focus();
richTextBox1.Focus();
findPos = richTextBox1.Find(searchText,findPos,richTextBox1.Text.Length, RichTextBoxFinds.WhatGoesHere?);
richTextBox1.Select(findPos, searchText.Length);
findPos += searchText.Length;
}
But there's no option for wholeword and matchcase so is there any way to do this with .Find()?
© Stack Overflow or respective owner