I have a RichTextBox where I need to update the Text property frequently, but when I do so the RichTextBox \"blinks\" annoyingly as it refreshes all throughout a method call
Found here: http://bytes.com/forum/thread276845.html
I ended up sending a WM_SETREDRAW via SendMessage to disable then reenable followed by an Invalidate() after I finished updating. That seemed to work.
I've never tried this method. I have written an application with a RTB that has syntax highlighting and used the following in the RTB class:
protected override void WndProc(ref Message m)
{
if (m.Msg == paint)
{
if (!highlighting)
{
base.WndProc(ref m); // if we decided to paint this control, just call the RichTextBox WndProc
}
else
{
m.Result = IntPtr.Zero; // not painting, must set this to IntPtr.Zero if not painting otherwise serious problems.
}
}
else
{
base.WndProc(ref m); // message other than paint, just do what you normally do.
}
}
Hope this helps.