Form Flicker

  • Thread starter Thread starter Michael
  • Start date Start date
M

Michael

Here is my problem:

I have a MDI application and when I load my child forms I get alot of
flicker.

I have tried to implement double buffering :
Public Sub New()
MyBase.New()

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

'Add any initialization after the InitializeComponent() call

' Stop the flicker
Me.SetStyle(ControlStyles.UserPaint, True)
Me.SetStyle(ControlStyles.DoubleBuffer, True)
Me.SetStyle(ControlStyles.AllPaintingInWmPaint, True)
End Sub

but it did not work.

Does anyone have any suggestions?

Mike
 
Michael,
My understanding is you need to call UpdateStyles after you call SetStyle.
Public Sub New()
MyBase.New()

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

'Add any initialization after the InitializeComponent() call

' Stop the flicker
Me.SetStyle(ControlStyles.UserPaint, True)
Me.SetStyle(ControlStyles.DoubleBuffer, True)
Me.SetStyle(ControlStyles.AllPaintingInWmPaint, True) Me.UpdateStyles()
End Sub

Do you child forms override the OnPaint method or have controls? If they
have controls, I do not believe the above will help, as each control still
needs to paint itself.

Hope this helps
Jay
 
Back
Top