Hi,
Im having problems with the value being returned by the richtextbox.Get LineFromCharInd ex method. Its returning a value that is more than the richtextbox.Lin es.Length.
Im trying to print selected lines of text from a richtextbox control.
Here is my sample code:
The lines of text in the richtextbox control is 3283.
int startPos = richTextCtrl.Se lectionStart;
printLineIndex = richTextCtrl.Ge tLineFromCharIn dex(startPos);
// Print each line of the file.
while ( count < linesPerPage && printLineIndex < printLineLimit )
{
line = richTextCtrl.Li nes[printLineIndex];
..//
I'm getting values that are greater than 3283; thus an exception is being thrown.
..
..
..
}
Can I implement it in a way that I'm not going to use the GetLineLineFrom CharIndex method?
Thanks,
Mark Caliston