C#窗口防止闪烁两种方法

public class PaintIncrease
    {
        public static void SetDoubleBuffered(object obj)
        {
            
            Type type = obj.GetType();
            PropertyInfo pi = type.GetProperty("DoubleBuffered",
                BindingFlags.Instance | BindingFlags.NonPublic);
            pi.SetValue(obj, true, null);
        }
    }
 protected override CreateParams CreateParams
        {
            get
            {
                
                CreateParams cp = base.CreateParams;
                cp.ExStyle |= 0x02000000;
                return cp;
            }

        }

 

posted @ 2018-02-09 22:32  zhaogaojian  阅读(2574)  评论(0编辑  收藏  举报