Hi,
Welcome to our Microsoft Q&A platform!
The reply form Kareninstructor
There may be, have not tried stuffing that many lines into a TextBox, you could try the following extension method, place into a static class in your project to see if that works.
Taken from https://stackoverflow.com/questions/15204830/get-index-of-line-from-textbox-c-sharp
public static int GetLineIndex(this TextBox textbox, int line)
{
var text = textbox.Text;
var thisLine = 0;
for (var i = 0; i < text.Length; i++)
{
if (thisLine == line)
return i;
if (text[i] == '\n')
++thisLine;
}
throw new ArgumentOutOfRangeException();
}
Or report this to Microsoft via the feedback button in Visual Studio.
Since this is WPF your post is being moved to the WPF forum.
Thanks.