all groups > dotnet windows forms > february 2008 >
You're in the

dotnet windows forms

group:

Fast control for bus monitor


Fast control for bus monitor kelvin.koogan@googlemail.com
2/27/2008 6:53:05 AM
dotnet windows forms: I am writing a bus monitor / protocol analyzer using VS 2005 C++/CLI.

Currently I am using a RichTextBox to display the messages. I am
adding each message with AppendText. This seems to be very slow; the
RichTextBox cannot keep up with the speed at which the messages come
in.

Is there a faster way to append new strings to the RichTextBox?

Alternatively is there a better control to use? The ListView seems to
update a little quicker but does not scroll as smoothly as the
messages are added.

TIA,
RE: Fast control for bus monitor AMercer
2/27/2008 10:02:01 AM
[quoted text, click to view]

You need to batch your updates to optimize performance. With an rtb,
collect some lines (eg with StringBuilder), and AppendText a batch to the
rtb. With a listview, collect some lines and use lv.Items.AddRange. I
suggest a timer to append whatever is batched to the control and have your
analyzer batch its output and not worry about updating the control.
AddThis Social Bookmark Button