المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Large text in RechTextBox



C# Programming
06-27-2009, 09:50 PM
Hi,
I am writing a small application that is used to investigate log files. Currently our QA teams are using TextPad for this task. My goal is to create an application that will be able to filter and search the log text for preset expressions.
The size of a typical log file is 2 - 3 MB, and contains about 30,000 lines.

I am using RichTextBox so I will be able to format text. I am using a StringBuilder to concatenate all the lines (note: I am using '\r\n" after each line). I then set the content of the stringBuilder to the RichTextBox:
textBox.Text += sb.ToString();

This causes the application to freeze. I tried SuspendLayout / ResumeLayout but as soon as the form is displayed the application freezes.
Limiting the lines to 10,000 prevents the freezing.

Any ideas?