H
H
hidden_pingvin2014-05-18 10:56:26
C++ / C#
hidden_pingvin, 2014-05-18 10:56:26

How to add a piece of text to a RichTextBox from a variable?

Hello. The task is as follows: there is a string variable that contains text (Txt), let's say for Txt.Length = 11000 characters, I need to unload excerpts at h = 1500 characters in the RichTextBox by pressing a button (that is, the first iteration 0 ... 1500 , pressed the button 1500 ... 3000, pressed the button 3000 ... 4500, etc.) and, accordingly, back, by pressing another button. I wrote an algorithm using the for loop, I have to upload each character in turn to the RichTextBox, in terms of performance, this is very slow. Can anyone suggest a method that can immediately take a passage from a variable (with an indication of the start and end position) or suggest another solution?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Eugene, 2014-05-18
@hidden_pingvin

String.Substring()

T
Terminaft, 2014-05-18
@Terminaft

Try using TextRange

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question