Is there a way to speed up the display of large amounts of text in the winforms text box?

Is there a way to speed up the display of large amounts of text in the winforms text box? My application reads a file (which can be up to 20 MB in size) and then displays it in a text box (TextBoxX.Text = fileText;).

The process of displaying text is very slow, sometimes it takes several minutes. The problem is that this application is designed to display a large amount of text in a file, quickly for the user.

Is there any way to do this faster? Maybe some kind of caching is used?

+2
source share
7 answers

, , "" , Application.DoEvents() .

", , ...", , DoEvents , "" .

0

, , , .

WordWrap = false, . - , . 90 , Base64, 16 2 .

+9

Text , TextBox. AppendText().

BackgroundWorker, , ReportProgress, AppendText(), .

Update

, , TextBox AppendText(), .

, Scintilla.Net. .

+3

, - (, , ), (, ) .

"" - , 500 , , .

0

, 20- .

( .. -).

, 1 .. .

psuedocode:

while ( ) { string content = 1024 * 1024 .. ascii.

textbox.text + = content

}

0

, RichTextBox. -, , TextBox, Text RichTextBox .

0
source

Source: https://habr.com/ru/post/1526327/


All Articles