New to Telerik UI for WinForms? Download free 30-day trial

Double Buffered Table Layout Panel

Environment

Product Version 2018.2.621
Product Telerik UI WinForms

Problem

You are using a TableLayoutPanels in your application but there is a flickering when the application is loaded or the theme is changed.

Solution

Use the following inherited class and which sets the Style:

public class DoubleBufferedTableLayoutPanel : TableLayoutPanel
{
    public DoubleBufferedTableLayoutPanel()
        : base()
    {
        this.SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
    }
}

Public Class DoubleBufferedTableLayoutPanel
    Inherits TableLayoutPanel

    Public Sub New()
        MyBase.New()
        Me.SetStyle(ControlStyles.UserPaint Or ControlStyles.AllPaintingInWmPaint Or ControlStyles.OptimizedDoubleBuffer, True)
    End Sub
End Class
In this article