Blink problem when loading form

0

I am doing a program in which I am uploading different forms in a panel. But when I load them, the screen flashes several times and it is very annoying. I used the DoubleBuffered=true but nothing. I'm thinking of using panels directly but for the design it's more convenient to use forms.

Private Sub AbrirFormEnPanel(ByVal Formhijo As Object)
        If Me.pnl_Fondo.Controls.Count > 0 Then
            Me.pnl_Fondo.Controls.RemoveAt(0)
        End If
        Dim fh As Form = TryCast(Formhijo, Form)
        fh.TopLevel = False
        fh.FormBorderStyle = Windows.Forms.FormBorderStyle.None
        fh.Dock = DockStyle.Fill
        Me.pnl_Fondo.Controls.Add(fh)
        Me.pnl_Fondo.Tag = fh
        fh.Show()

End Sub
    
asked by Guilmor 24.09.2018 в 08:45
source

1 answer

0

I have discovered the problem and therefore the solution. I write it in case someone happens to him and he can serve him.

In each of the forms I had loaded, I had put a background image and I think that when I loaded the form and then had to resize it, it had to be painted several times which caused the blinking. I have removed the background from the forms and I have left a flat color and it does not happen to me anymore. Thanks anyway and I hope it serves you.

    
answered by 24.09.2018 в 11:44