Paint Method Flicker

Cags

Well-known member
Joined
Feb 19, 2004
Messages
690
Location
Melton Mowbray, England
Im working on an application using the .Net Compact Framewok have got an annoying little problem. The problem is basically a visible flash that is visible on a tab page.

I have create my own component inherited from TabPage, and have then overridden the OnPaint method (essentially to draw an image to the tab page), i have done this by creating a graphics object, painting the bitmap to it (along with a few other things), then painting it to the screen. The problem occurs when there are other Controls on that tab page (which also incorporate buffering to a graphics object). The problem is essentially that the tabpage is not drawn where there is a control placed on it, so untill that controls OnPaint method had ran through, it just appears as a white square, is there any way of avoiding this? I essentially want to draw the complete tabpage, before starting to draw the controls....
 
Problem solved. For anyone else with this problem the solution I found was to call the .Refresh method of all the controls on the tabpage before painting the buffer to it. This seems to ensure that everything is painted at the same time.
 
Back
Top