Note that there are some explanatory texts on larger screens.

plurals
  1. PORestoring WinForm with textbox containing large amount of data
    primarykey
    data
    text
    <p>I have created a form in C# (VS2010) which contain (among other) a textbox control. The textbox may contain large amount of data at some point (~3 million chars).</p> <p>When scrolling or moving the form around no problems are encountered, but when the form is minimized and restored back again, a repaint sequence (I believe) is triggered which causes a big lag of around 5-10 seconds for the form to be repainted.</p> <p>I've already tried several solutions:</p> <ol> <li><p>Using double buffer – according to what I've read, double buffering applies only to the form itself and not to its controls</p> <p><code>this.SetStyle(ControlStyles.DoubleBuffer, true);</code> <code>this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);</code> <code>this.SetStyle(ControlStyles.UserPaint, true);</code></p></li> <li><p>Disabling the textbox redrew once minimized using: <code>SendMessage(this.my_textBox.Handle, WM_SETREDRAW, false, 0);</code> and enabling back after form is restored. I've noticed that the form repaint lag exist also if I <strong>don't re-enable the textbox repaint</strong>.</p></li> <li><p>Manual double buffer using a bitmap – similar results as #1.</p></li> </ol> <p>I read somewhere that this issue might be related to the textbox control trying to shrink or adjust to the amount of data, but couldn't override it.</p> <p>I previously had the same project in MFC, but didn't encounter any repaint or lagging issues there.</p> <p>Please advise me how to solve this issue.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload