Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i avoid form flickering ?
I tried SuspendLayout() and ResumeLayout().But it didn't help
Posted
Updated 23-May-11 20:00pm
v2

Try setting DoubleBuffered
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 24-May-11 2:10am    
Correct, my 5.
--SA
Shaheed Muhammed 28-Aug-13 6:52am    
it didnt work for me
Try this code to Prevent Form and control flickering

Protected Overloads Overrides ReadOnly Property CreateParams() As CreateParams
      Get
          Dim cp As CreateParams = MyBase.CreateParams
          cp.ExStyle = cp.ExStyle Or 33554432
          Return cp
      End Get
    End Property
 
Share this answer
 
v2
Comments
Richard MacCutchan 13-Jul-15 4:44am    
This question is more than four years old. Please do not post in dead questions.
xP_raul 21-May-17 23:25pm    
my project has a mdi form, I copied this code inside the mdi form class and it worked wonderful for all the child forms... thanks a lot Kishor Ahir
you Can Try this Function too
Private Sub PreVentFlicker()
        With Me
            .SetStyle(ControlStyles.OptimizedDoubleBuffer, True)
            .SetStyle(ControlStyles.UserPaint, True)
            .SetStyle(ControlStyles.AllPaintingInWmPaint, True)
            .UpdateStyles()
        End With

    End Sub

Call this in forms Load Event
 
Share this answer
 
Comments
Shaheed Muhammed 28-Aug-13 6:52am    
it didn't work for me
SM Genesis 11-Jun-14 8:03am    
didnt work for me either.
Member 13273427 11-Aug-17 13:55pm    
it worked for me thank you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900