Screen flicker problem

The most likely cause of the flicker is the OnPaintBackground event which fires before the OnPaint event. Using C# this can easily be solved by doing the following section of code. It is worth noting however that if you do override this method you must draw the entirity of the control (using either Graphics.Clear(), or another method such as DrawRectangle()) in the Paint method otherwise some sections will not get drawn

C#:
protected override void OnPaintBackground(PaintEventArgs pevent) 
{
	//base.OnPaintBackground (pevent);
}

With regards to the Invalidate() method all this really does is tells a control to redraw to the screen. When used in conjunction with a bitmap buffer this can reduce the amount of calculations that are performed by the Paint event.
 
Thanks Cags for the reply. I dont know C# though. Could you post the code in VB for me?

Thanx
 
Back
Top