ControlStyles.DoubleBuffer vs. ControlStyles.OptimizedDoubleBuffer

user113476 picture user113476 · Dec 27, 2009 · Viewed 7.7k times · Source

What is the difference between ControlStyles.DoubleBuffer and ControlStyles.OptimizedDoubleBuffer?

ControlStyles.DoubleBuffer does not show up in the Intellisense drop down whereas ControlStyles.OptimizedDoubleBuffer is in fact listed.

The MSDN documentation does not make the difference immediately clear (to me at least).

Answer

Justin picture Justin · Dec 27, 2009

I found this thread on the subject:

DoubleBuffered = true sets both ControlStyles.OptimizedDoubleBuffer AND ControlStyles.AllPaintingInWmPaint.

At one point the intention was to deprecate DoubleBuffer and adopt the use of OptimizedDoubleBuffer instead, however the thread goes into reasons why that might be a bad idea (that I dont understand)

It looks like the whole situation is a tad confused, however ultimately these two flags do very similar things - the thread indicates that there are still subtle differences between OptimizedDoubleBuffer and DoubleBuffer, but doesnt explain what they are.