i have a panel on a form onto which im drawing a little moving simulation. i had this working perfectly , flicker free on the form, but when i tried to put it on the panel it is terrible. i have overridden the panel_OnPaint() method to this:
i have the doubble buffering set up here
i have overridden the onPaintBackground() to do nothing.
i have tried overriding and leaving the form1_onPaint() but still the same problem happens. any ideas on what i can do now?
Code:
private void Pannel_Paint(object sender, System.Windows.Forms.PaintEventArgs g)
{//top walls
g.Graphics.FillRectangle(Brushes.Cyan,1,1,this.Width,this.Height);
foreach (Wall w in this.walls)
{
w.DrawWall(g.Graphics);
}
crowd.DrawToScreen(g.Graphics);
panel1.Invalidate();
}
i have the doubble buffering set up here
Code:
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.DoubleBuffer, true);
i have overridden the onPaintBackground() to do nothing.
i have tried overriding and leaving the form1_onPaint() but still the same problem happens. any ideas on what i can do now?
Last edited: