Below are some links about the textbox control's limitations:

http://www.developmentnow.com/g/36_2004_3_0_0_209735/TextBox-Capacity.htm
http://www.codeproject.com/Answers/121784/csharp-textbox-limit.aspx#answer1


Instead of a multiline textbox, have you tried the RichTextBox control
instead?

According to MSDN, it indicates that:

"Applications that already use TextBox controls can easily be adapted
to make use of RichTextBox controls. However, the RichTextBox control
does not have the same 64K character capacity limit of the TextBox
control. The RichTextBox is typically used to provide text
manipulation and display features similar to word processing
applications such as Microsoft Word."


Source: 
http://msdn.microsoft.com/en-us/library/system.windows.forms.richtextbox.aspx


Regards,


Benj




On Nov 10, 9:45 pm, Michael Busch <michael.n.bu...@googlemail.com>
wrote:
> Hi Guys.
>
> I have a problem, hopefully you can help me.
>
> I am working with automation software and on my HMI software I have a small
> performance problem.
> Sometimes it is possible to show the code of a control program, what it
> (sometimes) about 145,000 lines (or more).
>
> It comes out of the control as one string.
>
> I tried to show the code in a textbox, but this takes about one minute to
> show up. My HMI is frozen during the time.
> Yes, I am using a background worker (async), so I dont understand why it
> freezes up the whole HMI.
> (its only the line filling the multiline textbox).
> The code in this case is only one line:
>
> >> textbox1.text = codefromControl.code;
>
> So, I changes to code to a stringbuilder, which is filling the textbox.
> I splited the text up in lines, and tried different ways to fill up the
> textbox (trying as less refreshes of the textbox as possible).
>
> The best performance I got was 10,000 lines in 0.7 sec.
> But this means its still 15sec to load the screen (its frozen in all
> scenarios with my background worker, and I dont know why).
>
> So, I need to know
>
> - how can add my controlcode to the textbox with the best performance?
> - some ideas ( I know I dont posted code) why writing to the textbox freezes
> my HMI and why my background worker isnt working?
> - some ideas to increase performace? perhaps different control - listview,
> richtextbox, etc?
> - How can I realize that the screen is loaded, the first e.g. 1000 lines are
> displayed and the rest is loaded in the background ( I tried this out for a
> couple os days, but I got it never running (see the other problems, its
> always freezing up).
>
> Thanks a lot th everybody in advance.
>
> Mike

Reply via email to