drawing onto a pannel, doubble buffering doesnt work

fguihen

Well-known member
Joined
Nov 10, 2003
Messages
248
Location
Eire
im drawing a simulation onto a pannel on a form. i have set up the pannel_Paint method, and deligate. i am not invalidating() the form, just the pannel. the image on the pannel is all lines and fickery, las if double buffering was not working, but it is set up . what could be wrong?
 
First some dumb questions. Is the double buffering code put in the Public Sub New() sub?

Code:
    Public Sub New()
        MyBase.New()

        This call is required by the Windows Form Designer.
        InitializeComponent()

        Add any initialization after the InitializeComponent() call
        SetStyle(ControlStyles.AllPaintingInWmPaint, True)
        SetStyle(ControlStyles.DoubleBuffer, True)
        SetStyle(ControlStyles.ResizeRedraw, True)
    End Sub

A panel is usually one of the more stable controls to paint on. How are you calling the panels paint event? Panel1.Invalidate works pretty well... What code are you using in the Panels paint event? I hope that you are not adding an Invalidate call in the paint event.
 
Back
Top