473,394 Members | 1,852 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

RichTextBox very slow

I'm using a RichTextBox in a protocol analyser I'm developing. However
as the amount of data gets large, e.g. 500000 lines, the control
becomes very slow.

For example if I load in a saved file it can take 30 seconds just to
transfer data from a StringBuilder to the RichTextBox, even with
updates turned off with WM_SETREDRAW.

Also I highlight a line when the users clicks on it and this can be
slow, as can be highlighting all instances of a string match.

Is there any way to make actions like adding text to a RichTextBox or
highlighted portions of text any faster?

TIA,
KK
Jun 27 '08 #1
2 5702
<ke***********@googlemail.comschrieb:
I'm using a RichTextBox in a protocol analyser I'm developing. However
as the amount of data gets large, e.g. 500000 lines, the control
becomes very slow.

For example if I load in a saved file it can take 30 seconds just to
transfer data from a StringBuilder to the RichTextBox, even with
updates turned off with WM_SETREDRAW.

Also I highlight a line when the users clicks on it and this can be
slow, as can be highlighting all instances of a string match.

Is there any way to make actions like adding text to a RichTextBox or
highlighted portions of text any faster?
You can write the RTF code directly instead of selecting text and changing
its properties via the 'Selection*' properties. However, I wonder how a
user should be able to deal with 500,000 lines of text. Maybe you should
consider implementing a paging mechanism or something similar.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Jun 27 '08 #2
On 31 May, 14:29, "Herfried K. Wagner [MVP]" <hirf-spam-me-
h...@gmx.atwrote:
<kelvin.koo...@googlemail.comschrieb:
I'm using a RichTextBox in a protocol analyser I'm developing. However
as the amount of data gets large, e.g. 500000 lines, the control
becomes very slow.
For example if I load in a saved file it can take 30 seconds just to
transfer data from a StringBuilder to the RichTextBox, even with
updates turned off with WM_SETREDRAW.
Also I highlight a line when the users clicks on it and this can be
slow, as can be highlighting all instances of a string match.
Is there any way to make actions like adding text to a RichTextBox or
highlighted portions of text any faster?

You can write the RTF code directly instead of selecting text and changing
its properties via the 'Selection*' properties. *
I'm sorry I don't understand what you mean, could you explain a little
more please?
However, I wonder how a
user should be able to deal with 500,000 lines of text. *Maybe you should
consider implementing a paging mechanism or something similar.
I have considered this but it seems like a lot of work and my
timescales are very tight. Is there any simple way to do this?

TIA,
KK
>
--
*M S * Herfried K. Wagner
M V P *<URL:http://dotnet.mvps.org/>
*V B * <URL:http://dotnet.mvps.org/dotnet/faqs/>
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: S.W. Rasmussen | last post by:
A trivial (?) question: does anyone know how to change the shape of the cursor in a RichTextBox control from the normal vertical line to an underscore?
0
by: tiYakusa | last post by:
Hi everyone, I'm currently developping a C# usercontrol which is a kind of "MatLab" command editor. This usercontrol is currently based on a richtextbox control (called RTB in the next of...
0
by: Danny Carvajal | last post by:
Hello, I would like to load some text into a RichTextBox control with certain words in color. The only way I have been able to do this is AFTER the text has been loaded. And even that is slow,...
2
by: James dean | last post by:
I was using the RichTextBox property called SelectionStart to move through the text one character at a time to check to see if one character is different from the next. The problem is this property...
0
by: James dean | last post by:
In this program i set the RichTextBox property SelectionStart in order to move the caret(cursor) onto the next character. I have a loop to do this but unfortunately this is very slow. How would i...
9
by: James Wong | last post by:
Hi, I use the RichTextBox in my program. It will use different language in this RichTextBox (chinese and english characters), and it set the "DualFont" and use different fonts. By the way, how...
0
by: Vimalathithan | last post by:
I just developing a editor. I have provide the options like Bold, Italic, underlin, font change, font size change. These font options are keep in with one toolstripbutton. the toolstripbar keep...
0
by: dannyboy1990 | last post by:
I've been developing in vb.net for a few months now, well since i left school and one of my projects for my current company is to create a sql tool which is used on a daily basis to update, delete...
4
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, I have a multiline RichTextBox that I use for data logging. I'm concerned about how the AppendText method reacts when over time the maximum number of characters have been added. Do the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.