Answered by:
OptimizedDoubleBuffer

Question
-
Answers
-
-
That's a really good question.
ControlStyles == CS
AllPaintingInWMPaint == APWMP
OptimizedDoubleBuffer = ODB
DoubleBuffer = DB
An earlier permutation of the design called for ODB to simply be a combination of DB, APWMP and UserPaint. Through several design changes, the two control styles are nearly synonymous, but they still have differences. Now that we've broken that, we may consider un-deprecating CS.DB to retain . Here is a more complete summary of the current design:
Mechanism Side effects Other flags required to work Require APWMP? Notes ControlStyle
.DBnone
APWMP, UserPaint
Yes
We are considering NOT deprecating this flag because ODB isn't an exact replacement for DB. ControlStyle
.ODBnone
none
No
Works, but without APWMP set you'll buffer foreground and background separately and will still see flicker. Control
.DoubleBufferedsets CS.ODB, CS.APWMP
none
No
Works for most mainstream buffering needs. Getter is peculiar in that it only checks CS.ODB.
I'm following up on the need for deprecating CS.DB and Control.DoubleBuffered's getter and will post here. -
Action: We will pull the Obsolete attribute off ControlStyles.DoubleBuffer.
(side note) We considered cleaning up the API (ripping ODB) but adoption of the OptimizedDoubleBuffer flag within is high - meaning that it would break a lot of people. This is an ugly one we'll simply have doc and leave in the product. :(
All replies
-
-
-
-
-
That's a really good question.
ControlStyles == CS
AllPaintingInWMPaint == APWMP
OptimizedDoubleBuffer = ODB
DoubleBuffer = DB
An earlier permutation of the design called for ODB to simply be a combination of DB, APWMP and UserPaint. Through several design changes, the two control styles are nearly synonymous, but they still have differences. Now that we've broken that, we may consider un-deprecating CS.DB to retain . Here is a more complete summary of the current design:
Mechanism Side effects Other flags required to work Require APWMP? Notes ControlStyle
.DBnone
APWMP, UserPaint
Yes
We are considering NOT deprecating this flag because ODB isn't an exact replacement for DB. ControlStyle
.ODBnone
none
No
Works, but without APWMP set you'll buffer foreground and background separately and will still see flicker. Control
.DoubleBufferedsets CS.ODB, CS.APWMP
none
No
Works for most mainstream buffering needs. Getter is peculiar in that it only checks CS.ODB.
I'm following up on the need for deprecating CS.DB and Control.DoubleBuffered's getter and will post here. -
Erick,
So in summary, the difference between ControlStyles.DoubleBuffer and ControlStyles.OptimizedDoubleBuffer is that with OptimizedDoubleBuffer you can still get a PaintBackground event if ControlStyles.AllPaintingInWmPaint is not set, otherwise if ControlStyles.AllPaintingInWmPaint is set, they are the same.
Is that a correct summary?
This seems like a small difference. I think having both the DoubleBuffer and OptimizedDoubleBuffer styles is confusing to the user, and it would be good if you had some way of merging them back into a single style. -
Action: We will pull the Obsolete attribute off ControlStyles.DoubleBuffer.
(side note) We considered cleaning up the API (ripping ODB) but adoption of the OptimizedDoubleBuffer flag within is high - meaning that it would break a lot of people. This is an ugly one we'll simply have doc and leave in the product. :( -
How about placing it on OptimizedDoubleBuffer instead (the obsolete attribute)?
Sometimes I think you just need to make breaking changes between the beta and RTM if those changes are going to make it easier for users to delve into the Framework.I've been working with the Framework, especially Windows Forms consistantly for the last three years and I was confused about the difference between the two. How are new users going to grapple with it?
-
The API is unfortunate, but it is a ControlStyle which affects a minority of users. Typically, we'd suggest Control.DoubleBuffered.
Marking Obsolete is akin to ripping it - we generate build warnings for every project where it's being used. It's just plain too late for the change and we'll have to rely on the docs to explain i