Why does my double buffered form still flicker?
I was wondering if it someone could help me solve this problem. I have a full screen application with a panel in the center which is used to display different user controls and screens when the user uses the app. However, I have a rather large gradient image set as my form's background and it causes the panel to flicker every time controls are added. I find that when the background image is removed the flicker goes away. How can I keep the background image but eliminate the flicker? My form is already double buffered. Any help would be appreciated. Thanks.
Re: Why does my double buffered form still flicker?
By default, the BackgroundImageLayout property of the form is set to Tile. Try changing it to Stretch.
Re: Why does my double buffered form still flicker?
Create a buttered panel... Search for buffered panel
Kris
Re: Why does my double buffered form still flicker?
Quote:
Originally Posted by
weirddemon
By default, the BackgroundImageLayout property of the form is set to Tile. Try changing it to Stretch.
The background image is already set to stretch. Is there any way to disable the image from repainting each time a control is added to the panel?
Re: Why does my double buffered form still flicker?
Quote:
Originally Posted by
weirddemon
By default, the BackgroundImageLayout property of the form is set to Tile. Try changing it to Stretch.
The background image is already set to stretch. Is there any way to disable the image from repainting each time a control is added to the panel?
Re: Why does my double buffered form still flicker?
Setting the form's DoubleBuffered property doesn't make the panel double buffered. Changing the children of the panel at runtime could be causing the flickering. The Panel class has a DoubleBuffered property but it is Protected. One way to set it is to make a class which inherits from Panel:
vb Code:
Public Class DBPanel
Inherits Windows.Forms.Panel
Public Sub New()
Me.DoubleBuffered = True
End Sub
End Class
Then you use the DBPanel instead of a normal Panel.
BB