7

I am designing a Win Form in VB.NET and Using Table layout in it. Problem i facing is , My WinForm is flickering every time it is load.

Kindly suggest me permanent solution in VB.NET. Why this problem occurs? Is it because of Table Layout?

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Preeti
  • 1,386
  • 8
  • 57
  • 112

4 Answers4

10

Try setting DoubleBuffered form property to "true".

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Adrian Serafin
  • 7,665
  • 5
  • 46
  • 67
5

If you added any code to the Load event of the form that manipulates the UI use SuspendLayout() and ResumeLayout() to prevent flickering.

Emond
  • 50,210
  • 11
  • 84
  • 115
5

I had a problem with flickering after the form had loaded. Tried all advice without any real success. Stumbled on this piece of magic code somewhere while Googling the issue. Solved it 100% for me. Simply copy and paste it in form code. Well done to the author. When all else fails, try this.

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
Ray E
  • 134
  • 1
  • 9
  • Indeed it works like a charm. Some explanation here: https://stackoverflow.com/questions/16455305/flickering-and-createparams – 8oris Jan 23 '23 at 13:41
-1

I found a substantial improvement on one of my forms where double-buffering had done very little by adding

Me.Visible = False

early in the Form Load event.

PKanold
  • 139
  • 7