0

I have code here that works on forms and disable flickers but when I apply this code to a child form and open it inside the MdiContainer it corrupts it.

 'Remove Flicker Lag
    Protected Overrides ReadOnly Property CreateParams() As CreateParams
        Get
            Dim cp As CreateParams = MyBase.CreateParams
            cp.ExStyle = cp.ExStyle Or &H2000000
            ' Turn on WS_EX_COMPOSITED
            Return cp

        End Get
    End Property

Can anyone please help me?

Or maybe someone can suggest how to remove the flicker on a child form when open inside an MdiContainer?

theduck
  • 2,589
  • 13
  • 17
  • 23
Adam
  • 147
  • 1
  • 13
  • Check [Flickering and “CreateParams”](https://stackoverflow.com/questions/16455305/flickering-and-createparams) –  Nov 20 '19 at 15:29
  • 1
    There's flickering and *flickering*. If you repaint/refresh controls and you cause this to happen constantly, so you invalidate the buffer (or you have DWM composition enabled or you're setting `WS_EX_LAYERED` somewhere else), you have to fix your code. No *composition* will ever help if the code is not doing its part. Also, note that if you minimize/maximize the Window, you may find out that the `WS_EX_COMPOSITED` *effect* is gone. – Jimi Nov 20 '19 at 17:03
  • 1
    The number and type of controls in a Window also count. You may also use DoubleBuffering somehwere else. Painting the *BackGround* of a MDI container (not exactly its background) or using a Background Image, causes a lot of pain. – Jimi Nov 20 '19 at 17:16

0 Answers0