Reputation: 6483
I'm using visual studio 2008
I have a control that dispays a processed image. Whenever the processing parameters are changed, I'd like to update this picture, but without flickering. If I could prevent windows from blanking the area before I paint, the flicker should, for the most part go away.
Question is, how to do this?
Something like: this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); Should do it, except that requires me to subclass the TableLayoutPanel control (something I spent an hour trying to do), and with what I achieved, that had no effect.
Is there an easy way to turn off background painting of my control?
Upvotes: 3
Views: 5184
Reputation: 38825
Have you tried overriding the OnPaintBackground
event and doing nothing?
protected override void OnPaintBackground(PaintEventArgs pevent)
{
}
Upvotes: 6
Reputation: 13947
try this:
this.SuspendLayout();
// do update here
this.ResumeLayout();
Clarification: this
is the form
Upvotes: -1