vszilard
June 19th, 2002, 09:32 AM
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...
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...