Find method for RichTextBox
I wrote a little program which do some things. One of them was suposed to be a find method in a richtextbox. I followed the example from the SDK Documentation :
public int FindMyText(string text, int start){
int returnValue = -1;
int indexToText = txtBody.Find(text, start, RichTextBoxFinds.None);
if(indexToText >= 0){
returnValue = indexToText;
txtBody.SelectionStart = indexToText;
txtBody.SelectionLength = text.Length;
}
}
The problem is that the find command always return -1 (nothing was found..)
what i am missing...????
Thanks...
It is the weak who are cruel,
only the strong can be truly gentle!
Szilard