Bee Eee Blog

Archive for January 1st, 2008

C# Enabling Double buffering for a form.

by brian on Jan.01, 2008, under .NET, GUI, c#, coding

Ran across a simple how-to to enable double buffering for a form. Just put the code snippet in the form’s constructor after the InializeComponents

this.SetStyle(
            ControlStyles.AllPaintingInWmPaint |
            ControlStyles.UserPaint |
            ControlStyles.DoubleBuffer,true);

This gets rid of flicker, it also makes draw a tad slower.

Found the code at: http://www.bobpowell.net/doublebuffer.htm Thanks Bob Powell!

3 Comments more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...