C# Application Becomes Slow and Unresponsive as String in Multiline Textbox Grows

Posted by Jim Fell on Stack Overflow See other posts from Stack Overflow or by Jim Fell
Published on 2010-01-13T15:59:57Z Indexed on 2010/05/11 2:34 UTC
Read the original article Hit count: 299

Filed under:
|
|
|
|

Hello. I have a C# application in which a LOT of information is being added to a Textbox for display to the user. Upon processing of the data, almost immediately, the application becomes very slow and unresponsive. This is how I am currently attempting to handle this:

   var saLines = textBox1.Lines;
   var saNewLines = saLines.Skip(50);
   textBox1.Lines = saNewLines.ToArray();

This code is run from a timer every 100mS. Is there a better way to handle this? I am using Microsoft Visual C# 2008 Express Edition. Thanks.

© Stack Overflow or respective owner

Related posts about c#

Related posts about textbox