Tag Archives: double buffering

Reduce flickering by disabling OnPaintBackground

When an entire control is painted (e.g. hosting a windowed directx control) it can be beneficial to override OnPaintBackground

In case of a windowed directx control double buffering is not possible, in other cases it may not be desirable.

When the background is not shown because it’s overlapped entirely, not drawing it all will speedup things and reduce flicker.

Add the following to the control to override.

protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs e)
{
}

Lastest update in December 2011, inital post in December 2011