double buffering render of forms

  • Thread starter Thread starter Brian Henry
  • Start date Start date
B

Brian Henry

since winforms arnt double buffered, is there anyway to turn it into a
double buffered form? or would i need managed directx to do this.. thanks
 
Brian,
In addition to the link OHM gave.

Include the following in your Form or Control's constructor.

' Stop the flicker
Me.SetStyle(ControlStyles.UserPaint, True)
Me.SetStyle(ControlStyles.DoubleBuffer, True)
Me.SetStyle(ControlStyles.AllPaintingInWmPaint, True)
Me.SetStyle(ControlStyles.ResizeRedraw, True)
Me.UpdateStyles()

This needs to be in the class you are painting ON, which can be different
then the object where the paint handler is. I normally handle the Paint
event in the same class that I am painting on.

If you are not handing the paint event, the above does not make a
difference, or put another way, the above does not effect contained
controls.

Hope this helps
Jay
 
Back
Top