[Mono-winforms-list] (Rich)TextBox: Maximum reasonable string length?

Rolf Bjarne Kvinge rolflists at ya.com
Fri Jun 15 06:29:40 EDT 2007



> -----Original Message-----
> From: mono-winforms-list-bounces at lists.ximian.com [mailto:mono-
> winforms-list-bounces at lists.ximian.com] On Behalf Of Sponsel, Carsten
> (ext)
> Sent: viernes, 15 de junio de 2007 8:00
> To: mono-winforms-list at lists.ximian.com
> Subject: [Mono-winforms-list] (Rich)TextBox: Maximum reasonable string
> length?
> 
> Hi!
> 
> My application does P/Invoke-Calls into some native code, which
> asynchronosly calls back and pass some string value. That works fine,
> even for large strings. But when I want the string to be displayed in a
> System.Windows.Forms.(Rich)TextBox, the performance dramatically goes
> down the larger the string gets. Usually I get strings between 1 MB and
> 5 MB length. The mono application seems to hang - but it needs ages to
> just display the text (writing to console works fine) :-(   I used
> (Rich)TextBox.AppendText and (Rich)TextBox.Text property.  Is that a
> known issue? Is the (Rich)TextBox not supposed to display such large
> strings? Do I have to use another fast method? s there some sort of
> control that can handle it?
> 

The textbox isn't designed for displaying large strings, not even on Windows
(try opening a 5MB file in Notepad, it'll block a while as well). On Windows
I think the RichTextBox has a somewhat better performance (unless I remember
wrong, opening the same file with Wordpad is somewhat faster), but Mono uses
the same implementation for both. There's no faster way of doing it, the
controls have to read all the text, split it in lines, figure out line
lengths, etc., and our focus right now isn't about making things faster, but
making things work :) 

Rolf
 
> Thank you
> Carsten
> 
> 
> Mit freundlichen Grüßen
> 
> ASTRUM IT GmbH
> Carsten Sponsel
> Diplom-Informatiker (FH)
> SW-Ingenieur
> 
> Am Wolfsmantel 46
> D-91058 Erlangen
> Tel.: +49 9131 94 08 - 352
> Fax: +49 91 31 94 08-1 08
> mailto:Carsten.Sponsel at astrum-it.de
> 
> 
> Kontaktadresse Siemens:
> Siemens AG
> Medical Solutions
> MED MRZ
> 
> Henkestr. 127
> 91052 Erlangen, Germany
> Tel.: +49 9131 84 7649
> Fax: +49 91 31 84 6787
> mailto:HYPERLINK
> "mailto:carsten.sponsel.ext at siemens.com"carsten.sponsel.ext at siemens.com
> <mailto:HYPERLINK>
> 
> Siemens Aktiengesellschaft: Vorsitzender des Aufsichtsrats: Gerhard
> Cromme;
> Vorstand: Klaus Kleinfeld, Vorsitzender; Johannes Feldmayer, Heinrich
> Hiesinger, Joe Kaeser,
> Rudi Lamprecht, Eduardo Montes, Jürgen Radomski, Erich R. Reinhardt,
> Hermann Requardt, Uriel J. Sharef, Klaus Wucherer;
> Sitz der Gesellschaft: Berlin und München
> Registergericht: Berlin Charlottenburg, HRB 12300, München, HRB 6684
> WEEE-Reg.-Nr. DE 23691322
> 
> _______________________________________________
> Mono-winforms-list maillist  -  Mono-winforms-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-winforms-list
> 
> 
> 
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.472 / Virus Database: 269.8.16/849 - Release Date:
> 14/06/2007 12:44




More information about the Mono-winforms-list mailing list