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
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy