S
Steve Barnett
I have a rich text box that I'm trying to search for information. I want to
be able to search from the end of the text towards the start, so my first
Find method looks like:
RTBedit.Find(TextToFind, RTBedit.Text.Length, RichTextBoxFinds.Reverse);
This finds the last occurrence of TextToFind in the rich text box perfectly
well. I then want to go on to find the next occurrence towards the start of
the text, so I code:
RTBedit.Find(TextToFind, RTBedit.SelectionStart - 1,
RichTextBoxFinds.Reverse);
What I expected to see was the next occurrence highlighted. However, this
code ALWAYS highlights the same occurrence as the first find. It's not
searching backwards at all.It looks like RichTextBoxFinds.Reverse always
starts from the end of the rich text box.
Have I misinterpreted something here? I thought the RichTextBoxFinds.Reverse
was supposed to search backwards from the start position.
Any suggestions.
Thanks
Steve
be able to search from the end of the text towards the start, so my first
Find method looks like:
RTBedit.Find(TextToFind, RTBedit.Text.Length, RichTextBoxFinds.Reverse);
This finds the last occurrence of TextToFind in the rich text box perfectly
well. I then want to go on to find the next occurrence towards the start of
the text, so I code:
RTBedit.Find(TextToFind, RTBedit.SelectionStart - 1,
RichTextBoxFinds.Reverse);
What I expected to see was the next occurrence highlighted. However, this
code ALWAYS highlights the same occurrence as the first find. It's not
searching backwards at all.It looks like RichTextBoxFinds.Reverse always
starts from the end of the rich text box.
Have I misinterpreted something here? I thought the RichTextBoxFinds.Reverse
was supposed to search backwards from the start position.
Any suggestions.
Thanks
Steve