Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

How to: Reduce Graphics Flicker with Double Buffering for Forms and Controls 

For most applications, the default double buffering provided by the .NET Framework will provide the best results. Standard Windows Forms controls are double buffered by default. You can enable default double buffering in your forms and authored controls in two ways. You can either set the DoubleBuffered property to true, or you can call the SetStyle method to set the OptimizedDoubleBuffer flag to true. Both methods will enable default double buffering for your form or control and provide flicker-free graphics rendering. Calling the SetStyle method is recommended only for custom controls for which you have written all the rendering code.

For more advanced double buffering scenarios, such as animation or advanced memory management, you can implement your own double buffering logic. For more information, see How to: Manually Manage Buffered Graphics.

To reduce flicker

  • Set the DoubleBuffered property to true.

    DoubleBuffered = true;

- or -

  • Call the SetStyle method to set the OptimizedDoubleBuffer flag to true.

    SetStyle(ControlStyles.OptimizedDoubleBuffer, true);

See Also

Community Additions

© 2015 Microsoft