티스토리 뷰

C# Programming

C# DoubleBuffered

indieloper 2021. 12. 23. 11:31

using System.Reflection;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    public static class Extensions
    {
        public static void DoubleBuffered(this Control control, bool enabled)
        {
            var prop = control.GetType().GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
            prop.SetValue(control, enabled, null);
        }
    }
}